- File/Directory (Folder) Commands
- ls - list files
- cd - change directories
- Note: "." is the current directory, i.e., the directory you are in; ".." is the parent directory
- pwd - show the name of the current directory
- less filename - display the file filename on the screen on page at a time
- rm filename - remove file filename
- mv filename1 filename2 - rename filename1 to the new name filename2
- cp filename1 filename2 - make a copy of filename1 called filename2
- file filename - tells what kind of file filename is
- lpr filename - prints filename on the printer in ENS242
- cat filename - display file filename on the screen all at once
- Note: when used with input redirection, cat allows you to create a new file or duplicate an existing file, e.g., as in cat > filename or cat filename1 > filename2, respectively.
- Program Development Commands
- vi filename - edit filename using the text-based screen editor called vi. For the basic details on vi see here.
- g++ filename - compile and link the file filename
- a.out - this is not really a linux command, but the default name of the executable produced by g++.
- !v - run the last command that began with a v (note: you can replace the v with any letter(s) to run something else).
- history - show a list of the commands that you have run most recently
- !# - run command #, where # is a number of some command in the history (e.g., !10 runs command 10).