Difference between revisions of "Commands"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
Here are important commands that you should be aware of:
 
Here are important commands that you should be aware of:
  
* [[cat]] - input from stdin or a file and output to stdout or a file
+
* [[cat]] : input from stdin or a file and output to stdout or a file
* [[cd]] - change directory
+
* [[cd]] : change directory
* [[date]] - show and set the system date and time
+
* [[date]] : show and set the system date and time
* [[df]] - find out how much space is free on your disks
+
* [[df]] : find out how much space is free on your disks
 +
** df -h : find out how much space is free on your disks in a sensible format
 
* [[disown]] - removes a process from its parent process, allowing it to continue after the parent exits
 
* [[disown]] - removes a process from its parent process, allowing it to continue after the parent exits
* [[du]] - find out how much space is used on your disks
+
* [[dig]] - query a name server for a server's IP address
* [[echo]] - output a string to [[console]] (rather, to [[stdout]])
+
* [[du]] -sch * : find out how much space is used on your disks
** echo mem > /sys/power/state - put the computer into standby-mode
+
* [[echo]] : output a string to [http://simple.wikipedia.org/wiki/Command_Line_Interface console] (rather, to [[stdout]])
* [[ethtool]] - is a network cable connected and which link does it have?
+
** echo mem > /sys/power/state : put the computer into standby-mode
* [[fdisk]] - [[partition]] a [[hard disk]]
+
* [[ethtool]] : is a network cable connected and which link does it have?
* [[file]] - find out the type of a file
+
* [https://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux/ fdisk] : partition a [[hard disk]]
* [[hwinfo]] - find out what harddisk, processor, graphics card and so on you have
+
* [[file]] : find out the type of a file
* [[ldd]] - list dependencies of an executable file
+
* [[hwinfo]] : find out what harddisk, processor, graphics card and so on you have
* [[ls]] - list files
+
** hwinfo --block --short : find out what disks and partitions you have
* [[lsof]] - list open files in the system
+
** hwinfo --cpu --short: find out what processors you have
* [[netstat]] - show network connections
+
* [[ldd]] : list dependencies of an executable file
* [[ps]] - show running processes
+
* [[ls]] : list files
* [[route]] - manage the network routing table
+
** ls -ltr : list files, latest last
* [[scp]] - copy over the network
+
* [[lsof]] : list open files in the system
* [[sleep]] - waits for a given time
+
* mkdir : makes a directory
* [[ssh]] - call a program over the network on another computer
+
* [[netstat]] : show network connections
* [[strace]] - list all syscalls performed by a program
+
** netstat -putan : show network connections in a sensible way
* [[tar]] - pack and unpack file archives
+
* [[ps]] : show running processes
* [[top]] - show the top CPU/RAM consuming processes
+
** ps -A : show all running processes
 +
** ps -ef : show all processes and their uptime
 +
* [[route]] : manage the network routing table
 +
* [[scp]] : copy over the network
 +
* [[shred]] : wipe data off your computer
 +
* [[sleep]] : waits for a given time
 +
* [[ssh]] : call a program over the network on another computer
 +
* [[strace]] : list all syscalls performed by a program
 +
** strace -e open : list all files that a program reads/writes to/from
 +
* [[tar]] : pack and unpack file archives
 +
** tar -xvzf : unpack .tar.gz files
 +
** tar -xvjf : unpack .tar.bz2 files
 +
** tar -cvzf : pack to .tar.gz files
 +
* [[top]] : show the top CPU/RAM consuming processes
 
* [[vmstat]] - how much I/O is your computer doing?
 
* [[vmstat]] - how much I/O is your computer doing?
 
* [[which]] - where does a program lodge?
 
* [[which]] - where does a program lodge?
Line 32: Line 46:
 
= See also =
 
= See also =
 
* [[Special:WhatLinksHere/Commands|pages that link to here]]
 
* [[Special:WhatLinksHere/Commands|pages that link to here]]
 +
* [[software]]

Latest revision as of 08:47, 1 March 2020

Here are important commands that you should be aware of:

  • cat : input from stdin or a file and output to stdout or a file
  • cd : change directory
  • date : show and set the system date and time
  • df : find out how much space is free on your disks
    • df -h : find out how much space is free on your disks in a sensible format
  • disown - removes a process from its parent process, allowing it to continue after the parent exits
  • dig - query a name server for a server's IP address
  • du -sch * : find out how much space is used on your disks
  • echo : output a string to console (rather, to stdout)
    • echo mem > /sys/power/state : put the computer into standby-mode
  • ethtool : is a network cable connected and which link does it have?
  • fdisk : partition a hard disk
  • file : find out the type of a file
  • hwinfo : find out what harddisk, processor, graphics card and so on you have
    • hwinfo --block --short : find out what disks and partitions you have
    • hwinfo --cpu --short: find out what processors you have
  • ldd : list dependencies of an executable file
  • ls : list files
    • ls -ltr : list files, latest last
  • lsof : list open files in the system
  • mkdir : makes a directory
  • netstat : show network connections
    • netstat -putan : show network connections in a sensible way
  • ps : show running processes
    • ps -A : show all running processes
    • ps -ef : show all processes and their uptime
  • route : manage the network routing table
  • scp : copy over the network
  • shred : wipe data off your computer
  • sleep : waits for a given time
  • ssh : call a program over the network on another computer
  • strace : list all syscalls performed by a program
    • strace -e open : list all files that a program reads/writes to/from
  • tar : pack and unpack file archives
    • tar -xvzf : unpack .tar.gz files
    • tar -xvjf : unpack .tar.bz2 files
    • tar -cvzf : pack to .tar.gz files
  • top : show the top CPU/RAM consuming processes
  • vmstat - how much I/O is your computer doing?
  • which - where does a program lodge?
  • xosview - gives you a nice overview about system load: CPU, disks, swap etc.
  • zip - pack files so WinZip can extract them

See also