FANDOM


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 commandsEdit

The following is a list of linux commands.

sudo Edit

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 Edit

ls Edit

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>

cp Edit

Copies files.

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

mv Edit

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>

rm Edit

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

rm <path>

chmod Edit

chmod is used for changing the permissions of a file. Edit

chmod <permission model> <file name and path>

Process Management Edit

Killall Edit

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

killall <process name>

Package Management Edit

Debian based systems Edit

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

apt-get Edit

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 Edit

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 Edit

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

grep Edit

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

Eg:

grep "html" sample.html

sed Edit

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

  • search and replace
  • line deletion

etc

more/less Edit

command that displays files on the screen.

more <filename> or less <filename>

scp Edit

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

whoami Edit

The whoami command outputs the name of the current user.

echo Edit

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

md5sum Edit

Returns the md5 checksum of <file>

md5sum <file>

cat Edit

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

cat <file>

Example:

cat > file1.txt

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.