Common shell Commands
$ cd ..
Basic structure of a shell command
Using autocomplete and the history
command |
options |
arguments |
|
|---|---|---|---|
pwd |
Print working directory |
||
cd |
/path/to/folder/ |
Change directory - change the current working directory to a specific Folder |
|
ls |
-ahl |
/path/to/folder/ |
List information about files.
|
python |
/path/to/script.py |
Run a python 2.x or 3.x script 1 |
|
python3 |
/path/to/script.py |
Run a python 3.x script |
|
⇥ |
Autocomplete command (tab-key) |
||
Ctrl-P, ↑ |
Show the previous command (control-P or arrow-up key) |
||
Crtl-N, ↓ |
Show the next command (control-N or arrow-down key) |
||
Ctrl-R |
<search phrase> |
Search for a previous command (control-R) |
|
history |
Show the previous commands as a numbered list |
||
!<number> |
Execute a command from the numbered list of previous commands |
||
mkdir |
|||
open |
|||
rm |
|||
mv |
|||
ssh |
|||
sudo rapsi-config |
Footnotes
- 1
Depends on how python was configured when it was installed.
command |
options |
arguments |
|
|---|---|---|---|
touch |
-r |
file1 file2 |
Change file access and modification times
|
Common options and arguments
# Show version information
<command> -V --version
# Show available options and arguments
<command> -h --help
# Format and display the on-line manual pages
# NOTE: Press 'q' to exit the manual
man <command>
Fundamentals
# -c Create a new archive containing the specified items
# -f Specify the filename of the archive
# -v Verbose output
# -z Use zip/gzip for compression
tar -cfvz archive_name.tar.gz filename1 filename2 directory1
# -x Extract the contents from a tar file
tar -xfvz archive_name.tar.gz