Command Line Cheat Sheet
From Ark Linux Wiki
This is by no means a complete list -- if you see need to add another command, please do so.
The commands are separated into two tables based on category -- whether it is a "normal user" command (a command that can be run as a normal user without root (administrative) privileges) and root "root" commands (commands the require root (administrative) privileges"). Keep in mind that the apt commands listed below as normal user commands will be root commands on other distributions (Ark is unique in the fact that it can run apt as a normal user).
Normal User Commands:
| Command | Type of Command | Description | Example | What the example means |
|---|---|---|---|---|
| alias | Commands | Allows you to set an "alias" for another command; not permanent | alias dir cd | Makes it so that the dir command does the same thing as cd |
| apt-cache | Software installation | Search for installable software | ||
| apt-get | Software installation | Installs and uninstalls software | apt-get install kdegames | Installs kde-based games |
| cal | Time Tracking | Shows a Calendar | cal -3 | Shows a calendar for the current month |
| cd | Directory browsing | Change Directory | cd /home/arklinux/Desktop | Takes you to your Desktop directory |
| chmod | File management | Changes the permissions on a file or directory (requires -r to work on subdirectories) | chmod 777 ~/file | Changes the permissions to read/write/execute on a file or directory called file in your home directory |
| chown | File Management | Changes the own and/or group of a file or directory (requires -r to work on subdirectories) | chown user:group ~/file | Changes the owning user to user and the owning group to group on a file or directory called file in your home directory |
| date | Time Tracking | Tells you when a day is | date --date='25 Dec' +%A | What day is christmas this year? |
| echo | Printing to screen or file | Shows what you type on your screen, or exports it to a file | Echo "Hello World" > helloworld.txt | Puts Hello World into a file called hellworld.txt |
| kinfocenter | System information | Brings up a GUI hardware information center | kinfocenter | Brings up a GUI hardware information center |
| mkdir | Directories | Makes a directory | mkdir ~/directory | Makes a directory called directory in your home directory |
| mv | File management | Moves or renames file or directory (requires -r to move a directory) | mv ~file1.text ~/Desktop/file2.txt | Moves a file called file1.txt from your home directory to your desktop and renames it to file2.txt |
| nano | Text Editing | Edits a text file | nano ~/file.txt | Creates or edits a file called file.txt in your home directory |
| passwd | Password Management | Allows you to change your password | passwd | Asks you to enter your old password, then asks for a new one |
| pwd | Directory browsing | Prints the directory you are currently in into your terminal | pwd | Prints the directory you are currently in into your terminal |
| rm | File Management | Deletes (removes) a file or directory (requires -r for a directory) | rm ~/file1.txt | Deletes a file called called file.txt from your home directory |
| rsync | Downloading | Synchronize two files | rsync -P rsync://rsync.server.com/path/to/file file | Download the differences between local and downloaded file |
| ssh | Remote Login | Log in to a remote machine | ssh user@something.com | Connects to something.com and allows you to log in to something.com as user |
| uptime | System Management | Shows how long your computer has been on | uptime | |
| vi | Text Editing | Edits a text file | vi ~/file.txt | Creates or edits a file called file.txt in your home directory |
| wget | Downloading | Downloads a file from the command line | wget http://location.com/file_to_download | Downloads a file from http://location.com/file_to_download |
Root Commands:
| Command | Type of Command | Description | Example | What the example means |
|---|---|---|---|---|
| df | System Information | Shows free space and used space | df -h | Shows free space only |
| lspci | System Information | Shows pci devices | lspci -tv | Shows detailed pci information |
| lsusb | System Information | Shows usb devices | lsusb -tv | Shows detailed usb information |
| mount | Disc Loading | Mounts a CD or ISO image into your file system | mount -o loop file.iso /mnt/iso | Mounts an ISO image called file.iso to /mnt/iso |
| passwd | User Management | Changes the password for a user | passwd user | Changes the password for a user called user |
| useradd | User Management | Adds a user | useradd user | Adds a user called user |