Difference between revisions of "Linux commands"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) |
||
| (29 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Linux general commands == | == Linux general commands == | ||
| − | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
! Command !! Description | ! Command !! Description | ||
|- | |- | ||
| − | | | + | | [[Linux_command:_alias|alias]] || Creates a commnad |
| + | |- | ||
| + | | [[Linux_command:_alien|alien]] || Migrate packages from .rpm to .deb and vice versa | ||
| + | |- | ||
| + | | apropos <subject> || Sows commnads related to a subject | ||
|- | |- | ||
| − | | | + | | [[Linux_comand:_apt-get|apt-get]] || Package installation and system update |
|- | |- | ||
| − | | [[Linux_command: | + | | [[Linux_command:_awk|awk]] || CLI text processor |
|- | |- | ||
| cal || Shows calendar | | cal || Shows calendar | ||
| + | |- | ||
| + | | cat <filename> || Shows file content | ||
|- | |- | ||
| clear || Clear screen | | clear || Clear screen | ||
|- | |- | ||
| − | | | + | | [[Linux_command:_date|date]] || Shows date |
| + | |- | ||
| + | | [[Linux_command:_dd|dd]] || Create / Dump images | ||
|- | |- | ||
| − | | | + | | df || Shows the disk ussage. Example: df -h -x devtmpfs -x tmpfs |
|- | |- | ||
| − | | | + | | dpkg || .deb package installation: sudo dpkg -i packagename.deb |
|- | |- | ||
| [[Linux_command:_du|du]] || Disk ussage | | [[Linux_command:_du|du]] || Disk ussage | ||
|- | |- | ||
| − | | | + | | export VARIABLE=VALUE || To create system variables |
|- | |- | ||
| − | | | + | | [[Linux_command:_fsck|fsck]] || Check file system |
|- | |- | ||
| − | | | + | | [[Linux_command:_fdisk|fdisk]] || Disk partition utility |
| + | |- | ||
| + | | [[Linux_command:_find|find]] || Find files | ||
| + | |- | ||
| + | | free || Shows free memory | ||
| + | |- | ||
| + | | [[Linux:_gpg|gpg]] || GnuPG | ||
| + | |- | ||
| + | | [[Linux_comand:_grep|grep]] || finds text matching regex or text | ||
| + | |- | ||
| + | | head || Shows file start (-n, -f,...) | ||
| + | |- | ||
| + | | history || Shows the commnad history (contained in ~.bash_history) | ||
|- | |- | ||
| info <command> || Sows command info | | info <command> || Sows command info | ||
|- | |- | ||
| − | | | + | | [[Linux_command:_ln|ln]] || Create simbolic links |
| + | |- | ||
| + | | lsb_release -a || Show os name and version | ||
| + | |- | ||
| + | | lsblk || | ||
|- | |- | ||
| − | | | + | | lspci -v || View PCI device information |
|- | |- | ||
| − | | | + | | lscpu || List cpu cores |
|- | |- | ||
| − | | | + | | lsof || <nowiki>sudo lsof -i -n | egrep '\<ssh\>'</nowiki> |
|- | |- | ||
| − | | | + | | man <command> || Sowhs a command manual page |
|- | |- | ||
| − | | | + | | mc || Midnight commander. File system navigation |
|- | |- | ||
| − | | | + | | mkdosfs -F32 /dev/mmcblk0 || Format SD card with FAT32 |
|- | |- | ||
| − | | | + | | more <filename> || Shows file content, screen by screen |
|- | |- | ||
| − | | | + | | mount || File sistem mounting |
|- | |- | ||
| − | | | + | | pwd || Shows working directory |
|- | |- | ||
| rsync -a ruta1 ruta2 [--exclude=/{dir1, dir2..]/] || Copies files from ruta1 to ruta2 excluding dir1, dir2,... | | rsync -a ruta1 ruta2 [--exclude=/{dir1, dir2..]/] || Copies files from ruta1 to ruta2 excluding dir1, dir2,... | ||
|- | |- | ||
| − | | | + | | [[Linux command: rename|rename]] || Rename files allowing regex |
|- | |- | ||
| − | | | + | | scp || Copy files to a remote machine over ssh protocol |
|- | |- | ||
| − | | [[ | + | | [[Linux:_SSH|ssh]] || ssh (Secure Shell) |
|- | |- | ||
| − | | [[ | + | | [[Linux_command:_sed|sed]] || String replacement |
|- | |- | ||
| − | | | + | | sort || Sorts the content of a file line by line |
|- | |- | ||
| su || Log as root at the terminal (sudo su) | | su || Log as root at the terminal (sudo su) | ||
|- | |- | ||
| − | | | + | | sudo <command>|| Execute command as root |
| + | |- | ||
| + | | [[Linux_command:_tar|tar]] || Compress/decompress tar files | ||
| + | |- | ||
| + | | [[Linux command: tail|tail]] || Shows file end (-n, -f, ...) | ||
| + | |- | ||
| + | | touch <file_name> || Creates an empty file | ||
|- | |- | ||
| − | | | + | | tty || Shows the terminal where you are connected |
|- | |- | ||
| − | | | + | | [[Linux_command:_uname|uname]] || Shows system info |
|- | |- | ||
| − | | [[ | + | | [[Linux_comand:_visudo|visudo]] || visudo is used to securely edit /etc/sudoers |
|- | |- | ||
| − | | | + | | wc -l || Counts lines |
|- | |- | ||
| [[Linux_command:_wget|wget]] || Download files/web pages | | [[Linux_command:_wget|wget]] || Download files/web pages | ||
|- | |- | ||
| − | | [[ | + | | [[Linux:_vim|vim]] || Text file editor |
| + | |- | ||
| + | | who || Connected persons | ||
| + | |- | ||
| + | | whoami || Who am i | ||
|- | |- | ||
| − | | [[Linux_command: | + | | [[Linux_command:_xargs|xargs]] || Send output of command to stdin |
|- | |- | ||
| − | | | + | | <nowiki><cmd1> | <cmd2></nowiki> || Pipe: takes the output of command1 as input of command2. example: <nowiki>cat /etc/passwd | sort | more</nowiki> |
|} | |} | ||
| − | |||
| − | |||
| − | |||
== Users and File permissions == | == Users and File permissions == | ||
| Line 137: | Line 167: | ||
|- | |- | ||
|} | |} | ||
| − | |||
| − | |||
== Firewall == | == Firewall == | ||
| Line 156: | Line 184: | ||
|- | |- | ||
! Command !! Description | ! Command !! Description | ||
| + | |- | ||
| + | | [[Linux command: netstat|netstat]] || | ||
| + | |- | ||
| + | | nmap || Network mapping | ||
|- | |- | ||
| nm-tool || Network monitor tool | | nm-tool || Network monitor tool | ||
| Line 174: | Line 206: | ||
== Linux key files/directories == | == Linux key files/directories == | ||
See: [[Linux:_Key_files/folders|Linux key files/directories]] | See: [[Linux:_Key_files/folders|Linux key files/directories]] | ||
| + | |||
== Programs == | == Programs == | ||
| Line 179: | Line 212: | ||
|- | |- | ||
! Command !! Description | ! Command !! Description | ||
| + | |- | ||
| + | | [[Linux_command:_git|git]] || Software repository | ||
| + | |- | ||
| + | | coursera-dl || | ||
| + | |- | ||
| + | | [[Jp2a|jp2a]] || Jpg to ASCII | ||
|- | |- | ||
| [[Linux:_John|john]] || John the ripper | | [[Linux:_John|john]] || John the ripper | ||
| + | |- | ||
| + | | [[Linux:_macchanger|macchanger]] || Change MAC address | ||
| + | |- | ||
| + | | openvpn || Connect to VPN | ||
| + | |- | ||
| + | | [[Linux_command:_terminator|terminator]] || Advanced terminal | ||
| + | |- | ||
| + | | [[Virtualenv|virtualenv]] || Create virtual enviroments | ||
| + | |- | ||
| + | | [[Virtualenvwrapper|virtualenvwrapper]] || Simplify virtualenv ussage | ||
|- | |- | ||
| [[Linux:_youtube-dl|youtube-dl]] || YouTube video downloader | | [[Linux:_youtube-dl|youtube-dl]] || YouTube video downloader | ||
|} | |} | ||
| + | vnc:escritorio remoto | ||
| + | == Save command without running to recover later == | ||
| + | ctrl+u --> saves | ||
| + | ctrl+y --> recover | ||
Latest revision as of 17:51, 10 September 2018
Linux general commands
| Command | Description |
|---|---|
| alias | Creates a commnad |
| alien | Migrate packages from .rpm to .deb and vice versa |
| apropos <subject> | Sows commnads related to a subject |
| apt-get | Package installation and system update |
| awk | CLI text processor |
| cal | Shows calendar |
| cat <filename> | Shows file content |
| clear | Clear screen |
| date | Shows date |
| dd | Create / Dump images |
| df | Shows the disk ussage. Example: df -h -x devtmpfs -x tmpfs |
| dpkg | .deb package installation: sudo dpkg -i packagename.deb |
| du | Disk ussage |
| export VARIABLE=VALUE | To create system variables |
| fsck | Check file system |
| fdisk | Disk partition utility |
| find | Find files |
| free | Shows free memory |
| gpg | GnuPG |
| grep | finds text matching regex or text |
| head | Shows file start (-n, -f,...) |
| history | Shows the commnad history (contained in ~.bash_history) |
| info <command> | Sows command info |
| ln | Create simbolic links |
| lsb_release -a | Show os name and version |
| lsblk | |
| lspci -v | View PCI device information |
| lscpu | List cpu cores |
| lsof | sudo lsof -i -n | egrep '\<ssh\>' |
| man <command> | Sowhs a command manual page |
| mc | Midnight commander. File system navigation |
| mkdosfs -F32 /dev/mmcblk0 | Format SD card with FAT32 |
| more <filename> | Shows file content, screen by screen |
| mount | File sistem mounting |
| pwd | Shows working directory |
| rsync -a ruta1 ruta2 [--exclude=/{dir1, dir2..]/] | Copies files from ruta1 to ruta2 excluding dir1, dir2,... |
| rename | Rename files allowing regex |
| scp | Copy files to a remote machine over ssh protocol |
| ssh | ssh (Secure Shell) |
| sed | String replacement |
| sort | Sorts the content of a file line by line |
| su | Log as root at the terminal (sudo su) |
| sudo <command> | Execute command as root |
| tar | Compress/decompress tar files |
| tail | Shows file end (-n, -f, ...) |
| touch <file_name> | Creates an empty file |
| tty | Shows the terminal where you are connected |
| uname | Shows system info |
| visudo | visudo is used to securely edit /etc/sudoers |
| wc -l | Counts lines |
| wget | Download files/web pages |
| vim | Text file editor |
| who | Connected persons |
| whoami | Who am i |
| xargs | Send output of command to stdin |
| <cmd1> | <cmd2> | Pipe: takes the output of command1 as input of command2. example: cat /etc/passwd | sort | more |
Users and File permissions
| Command | Description | ||
|---|---|---|---|
| adduser | Add users | w | Show connected users |
| chown <NewOwner>:<NewGroup> <File> | Change file owner | ||
| chgrp <NewGroup> <File> | Change group of file | ||
| chmod | Change file permissions |
Processes
| Command | Description |
|---|---|
| CTRL + C | Stop process |
| CTRL + Z | Pause process |
| %PID | Recover paused process |
| <command>& | Execute command in second plane |
| bg <command> | Execute command in second plane |
| ps | List processes |
| pstree | Show process tree |
| top | Processes viewer |
| htop | Process viewer more advanced than top |
| kill %PID | Terminate process |
| nice, renice | Process priorities: nice -n <command> |
| nohup <command> | Execute process avoiding its stop if the terminal is stopt |
| pgrep <pattern> | Retruns process that matches pattern |
| locate <program> | Returns program path |
Firewall
| Command | Description |
|---|---|
| iptables | Firewall rules |
| service iptables [start, stop] | Activate/deactivate firewall |
| route -n | Shows routing table |
Networking
| Command | Description |
|---|---|
| netstat | |
| nmap | Network mapping |
| nm-tool | Network monitor tool |
| nm-connection-editor | Network monitor editor |
| ifconfig | Show network configuration |
| iwconfig | Show WiFi connections |
| service networkmanager restart | Restart network daemon |
Network Manager configuration files:
- /etc/NetworkManager/system-connections/name-of-connection
Network configuration file:
- /etc/network/interfaces
Linux key files/directories
See: Linux key files/directories
Programs
| Command | Description |
|---|---|
| git | Software repository |
| coursera-dl | |
| jp2a | Jpg to ASCII |
| john | John the ripper |
| macchanger | Change MAC address |
| openvpn | Connect to VPN |
| terminator | Advanced terminal |
| virtualenv | Create virtual enviroments |
| virtualenvwrapper | Simplify virtualenv ussage |
| youtube-dl | YouTube video downloader |
vnc:escritorio remoto
Save command without running to recover later
ctrl+u --> saves ctrl+y --> recover