UNIX commands
UNIX commands are the command line instructions you enter into a terminal, such as the one in Replit.Unix commands are cryptic, usually between two to five characters in length. However, they represent the function they perform. For example, ls is the command to get a directory listing. The general format for Unix commands is:
where "command" is the name of some command followed by a number of options or arguments. Options are generally single characters that represent specific options. The minus sign "-" should be entered before an option.
and then type in ls -l
Unix is case-sensitive, so be sure you enter the options and arguments in the proper case. Generally lower case is used for commands.
Some UNIX commands
touch |
Create a new file, such as touch hello.cpp |
cd path |
change directory. |
cd |
change to home directory |
cp path1 path2 |
Copy file(s). |
chmod permissions path |
change the mode, the permissions, on a file or directory.
|
ls |
to get a listing of files in a directory |
man command |
to get a Unix Manual entry for a command. |
man -k topic |
use the -k option to find all the entries for a specific topic. |
mkdir path |
make a directory |
more command | When the command is executed, more pauses the output when the screen is full. You can view the next screenful or just the next line. Look for the instructions at the bottom of the screen. Enter q to exit more. |
mv file1 file2 |
move file1 to file2 or rename file1 to file2. The original file is deleted. |
passwd |
Change your Unix password. |
pwd |
print working directory, i.e. show current path. |
rm path | to delete (remove) a file |
rmdir path |
to delete (remove) a directory. |
script file_name |
cause everything that appears on the screen to be placed in the file_name. |
A complete UNIX tutorial can be found on http://www.ee.surrey.ac.uk/Teaching/Unix/