Difference between revisions of "Linux commands"

From RHS Wiki
Jump to navigation Jump to search
Line 67: Line 67:
 
|-
 
|-
 
| sudo <command>|| Execute command as root
 
| sudo <command>|| Execute command as root
 +
|-
 +
| [[Linux_command:_tar|tar]] || Compress/decompress tar files
 
|-
 
|-
 
| tail || Shows file end (-n, -f, ...)
 
| tail || Shows file end (-n, -f, ...)

Revision as of 20:13, 8 April 2015

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
cal Shows calendar
cat <filename> Shows file content
clear Clear screen
date Shows date
df Shows the disk ussage. Example: df -h
dpkg .deb package installation: sudo dpkg -i packagename.deb
du Disk ussage
fdisk Disk partition utility
find Find files
free Shows free memory
grep <text> finds 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
lspci -v View PCI device information
man <command> Sowhs a command manual page
mc Midnight commander. File system navigation
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,...
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
wc -l Counts lines
wget Download files/web pages
vim Text file editor
who Connected persons
whoami Who am i
<cmd1> | <cmd2> Pipe: takes the output of command1 as input of command2. example: cat /etc/passwd | sort | more


  • Bulleted list item

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

vnc:escritorio remoto

Firewall

Command Description
iptables Firewall rules
service iptables [start, stop] Activate/deactivate firewall
route -n Shows routing table

Networking

Command Description
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
jp2a Jpg to ASCII
john John the ripper
terminator Advanced terminal
youtube-dl YouTube video downloader