Linux/1-Commands: Difference between revisions

From Wiki
No edit summary
No edit summary
Line 27: Line 27:
| create dir
| create dir
| mkdir /var/test
| mkdir /var/test
|
|-
|-
| rm
| rm
Line 32: Line 33:
| remove file/dir
| remove file/dir
| rm autoexec.bat
| rm autoexec.bat
|
|-
|-
| cp
| cp
| %from %to
| %from %to
| copy
| copy
|
|
|
|-
|-
Line 41: Line 44:
| %from %to
| %from %to
| move
| move
|
|
|
|-
|-
Line 47: Line 51:
| low level copy
| low level copy
| dd if=/dev/sda2 of=/dev/sdb2  
| dd if=/dev/sda2 of=/dev/sdb2  
|
|-
|-
| nano
| nano
Line 52: Line 57:
| file editor
| file editor
| nano
| nano
|
|-
|-
| vi(m)
| vi(m)
Line 57: Line 63:
| file editor
| file editor
| vi config.txt
| vi config.txt
|
|-
|-
|colspan="4" style="background-color:#ffffff;"| <br> '''Search'''
|colspan="4" style="background-color:#ffffff;"| <br> '''Search'''
Line 64: Line 71:
| locate file
| locate file
| locate fstab
| locate fstab
|
|-
|-
| updatedb
| updatedb
|
|
| update locate database
| update locate database
|
|
|
|-
|-
Line 73: Line 82:
| / -n %filename
| / -n %filename
| search for file
| search for file
|
|
|
|-
|-
Line 81: Line 91:
| show kernel version
| show kernel version
| uname -a
| uname -a
|
|-
|-
| free
| free
Line 86: Line 97:
| show free memory
| show free memory
| free -m
| free -m
|
|-
|-
| fdisk
| fdisk
| -l
| -l
|  
|  
|
|
|
|-
|-
Line 96: Line 109:
| show harddisk usage
| show harddisk usage
| df -Th
| df -Th
|
|-
|-
| du
| du
|  
|  
|
|
|
|
|
Line 105: Line 120:
|  
|  
| show network settings
| show network settings
|
|
|
|-
|-
Line 111: Line 127:
| show processes
| show processes
| ps -aux  
| ps -aux  
|
|-
|-
| top
| top
|
|
| show processes with UI
| show processes with UI
|
|
|
|-
|-
Line 120: Line 138:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 125: Line 144:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 130: Line 150:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 136: Line 157:
|
|
| (extra package)
| (extra package)
|
|-
|-
| netstat
| netstat
|
|
|
|
|
Line 145: Line 168:
|
|
| show network interface statistics (extra package)
| show network interface statistics (extra package)
|
|
|
|-
|-
| who, w
| who, w
|
|
|
|
|
Line 153: Line 178:
|-
|-
| pwd
| pwd
|
|
|
|
|
Line 160: Line 186:
|-
|-
| runlevel
| runlevel
|
|
|
|
|
Line 166: Line 193:
| init  
| init  
| %rlvl
| %rlvl
|
|
|
|
|
|-
|-
| halt
| halt
|
|
|
|
|
Line 175: Line 204:
|-
|-
| reboot
| reboot
|
|
|
|
|
Line 181: Line 211:
| shutdown
| shutdown
| -h now
| -h now
|
|
|
|
|
Line 189: Line 220:
|
|
| download files
| download files
|
|
|
|-
|-
Line 194: Line 226:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 199: Line 232:
|  
|  
| get dns info
| get dns info
|
|
|
|-
|-
Line 204: Line 238:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 209: Line 244:
|
|
| get dns info
| get dns info
|
|
|
|-
|-
Line 214: Line 250:
|
|
| (extra package)
| (extra package)
|
|
|
|-
|-
Line 219: Line 256:
| -n
| -n
| show active routes
| show active routes
|
|
|
|-
|-
Line 224: Line 262:
|
|
| show network route to target address
| show network route to target address
|
|
|
|-
|-
Line 230: Line 269:
| show open ports
| show open ports
| netstat -tulpn
| netstat -tulpn
|
|-
|-
| iwconfig
| iwconfig
|
|
| show wifi settings
| show wifi settings
|
|
|
|-
|-
Line 239: Line 280:
|
|
| scan for wifi networks
| scan for wifi networks
|
|
|
|-
|-
| nethogs
| nethogs
|
|
|
| (extra package)
| (extra package)
Line 250: Line 293:
| apt install  
| apt install  
| <package> (-s = simulation)
| <package> (-s = simulation)
|
|
|
|
|
|-
|-
| apt update
| apt update
|
|
|
|
|
Line 259: Line 304:
|-
|-
| apt upgrade
| apt upgrade
|
|
|
|
|
Line 264: Line 310:
|-
|-
| apt dist-upgrade
| apt dist-upgrade
|
|
|
|
|
Line 269: Line 316:
|-
|-
| aptitude
| aptitude
|
|
|
|
|
Line 274: Line 322:
|-
|-
| dpkg -c
| dpkg -c
|
|
|
|
|
Line 279: Line 328:
|-
|-
| dpkg --get-selections
| dpkg --get-selections
|
|
|
|
|
Line 284: Line 334:
|-  
|-  
| /etc/apt/sources.list
| /etc/apt/sources.list
|
|
|
|
|
Line 293: Line 344:
|
|
| read smart info
| read smart info
|
|
|
|-
|-
Line 298: Line 350:
|
|
| set parameters
| set parameters
|
|
|
|-
|-
|
|
|
|
|
Line 305: Line 359:
|
|
|-
|-
|
|
|
|
|
Line 310: Line 365:
|
|
|-
|-
|
|
|
|
|

Revision as of 10:43, 9 December 2017

Command Arguments Info Example Other

Basic
dir -Flah list folder content dir -Flah
cat %file show file content cat config.txt

Files
mkdir %dir create dir mkdir /var/test
rm %file remove file/dir rm autoexec.bat
cp %from %to copy
mv %from %to move
dd if=%in of=%out low level copy dd if=/dev/sda2 of=/dev/sdb2
nano (%file) file editor nano
vi(m) %file file editor vi config.txt

Search
locate %file locate file locate fstab
updatedb update locate database
find / -n %filename search for file

System info
uname -a show kernel version uname -a
free -m show free memory free -m
fdisk -l
df -Th show harddisk usage df -Th
du
ifconfig show network settings
ps -aux show processes ps -aux
top show processes with UI
htop (extra package)
iotop (extra package)
iftop (extra package)
virt-top (extra package)
netstat
vnstat show network interface statistics (extra package)
who, w
pwd

Runlevel
runlevel
init %rlvl
halt
reboot
shutdown -h now

Network
wget download files
ntpdate (extra package)
dig get dns info
whois (extra package)
nslookup get dns info
finger (extra package)
route -n show active routes
traceroute show network route to target address
netstat -tulpn show open ports netstat -tulpn
iwconfig show wifi settings
iwlist scan scan for wifi networks
nethogs (extra package)

Apt
apt install <package> (-s = simulation)
apt update
apt upgrade
apt dist-upgrade
aptitude
dpkg -c
dpkg --get-selections
/etc/apt/sources.list

HDD
smartctl read smart info
hdparm set parameters