Programmer's Wiki
This page needs cleanup.

Linux provides a command-line interface. To be able to use it properly you need to know what commands to use. Linux commands are case-sensitive.

List of commands[]

The following is a list of linux commands.


Sudo stands for substitute user do and can be used to execute a single command as root.

sudo <command>

for instance to copy a file as root, type:

sudo cp <file> <new file>

File Management[]


list lists files (and subdirectories) in the provided path name. If no path name is applied, the files of the current directory will be listed instead.

ls <path>


Copies files.

cp <path to file> <path to file in new directory>


moves a file to a new directory. This command is also commonly used to rename files, by giving the same directory as the second parameter but with another file name.

mv <path to file> <path to file in new directory>


The rm command is used for removing file(s). Syntax:

rm <path>


chmod is used for changing the permissions of a file.[]

chmod <permission model> <file name and path>

Process Management[]


The killall command kills all PID's with the parameter as their name.

killall <process name>

Package Management[]

Debian based systems[]

Debian-based systems use apt-get for installing packages from a repository and dpkg for installing local deb files.


Use the apt-get command to install packages from remote repositories. Must be run as root.

sudo apt-get <option> <package name>

To install a package use install as parameter, to remove/uninstall a package use remove as parameter. Additional options include:

  • apt-get update to update the package list
  • apt-get --reinstall install <package name> to reinstall a package

dpkg allows installation of local packages. The most common parameter is -i for installing software. dpkg has to be run as root.

sudo dpkg -i <path to local package>

RPM based systems[]

RPM based systems use the Yum command for both installing packages from repositories as well as for local packages, or rpm files.


grep prints out the lines in a file or standard input that match a specified regular expression


grep "html" sample.html


sed is a command that can perform many line editing operations such as

  • search and replace
  • line deletion



command that displays files on the screen.

more <filename> or less <filename>


Secure copy is a command that allows you to copy files remotely from another machine.


The whoami command outputs the name of the current user.


The echo command outputs the text used as parameters, IE echo "Hello World!" would output Hello World!


Returns the md5 checksum of <file>

md5sum <file>


cat is used to return the contents of a file. <file> is the pathname of the file to print the contents of.

cat <file>


cat > file1.txt