|
Type commands on the command line, following the command prompt. When you press <Enter> after typing the command, the command is executed. While the command is executing, no system prompt displays. When the command finishes running, the system prompt displays, indicating that the shell is ready to accept another command. Tip While a command is executing, you can stop it by pressing <Ctrl+c>. A command consists of the command, options, and arguments in the following format: commandname options arguments where
The following command shows a command name, an option, and an argument: ls -l /home/janet Thels command lists the files in a directory. The argument is a path to a directory; the files in the directory specified by the argument (janet) are displayed on the screen. However, ls is a command that doesn't require an argument, using a default when you don't pass an argument. If you don't include a directory name, the ls command lists the files in the current directory. The -l is one of many options you can use with the ls command to determine the information displayed and its format. The -l option produces output with more information than the standard ls output. The output from the standard command, without the -l, is the following list of files in the directory /home/janet: ls /home/janet text.txt text2.txt while the output from the ls command with the -l is longer, as shown below: ls l /home/janet -rw-r--r-- 1 janet janet 50 Apr 25 11.09 test.txt -rw-r--r-- 1 janet janet 52 Apr 25 11.15 test2.txt You can enter more than one option as follows: ls -ld /home/janet You can enter more than one command, separated by a semicolon (;), as follows: ls /home/janet; ls /home/kim Tip You can enter commands that are more than one line long. Type a backslash (\) at the end of the line, before pressing Return, and the second line will be treated as a continuation of the first line.
|
|