top of page

Linux Commands


Linux Commands

When we using Linux OS, we have to use commands for performing some tasks. though we have GUIs some of tasks cannot perform through them. So learning Linux commands are very important if we are going to use Linux type OS.

Important Commands

1. File Commands

ls - list the contents of the current directory in short form ls -l - detailed list ls -a - displays hidden files

cd sourcefile targetfile- copies source file to target file cp -i sourcefile targetfile - Waits for confirmation, if necessary, before an existing target file is overwritten cp -r sourcefile targetfile - Copies recursively (includes subdirectories)

mv sourcefile targetfile - copies source file target file and delete source file mv -b sourcefile targetfile - Creates a backup copy of the source file before moving mv -i sourcefile targetfile - Waits for confirmation, if necessary, before an existing target file is overwritten

rm file(s) - Removes the specified files from the file system rm -r file(s) - Deletes any existing subdirectories rm -i file(s) - Waits for confirmation before deleting each file

cd - change to user's home directory cd directory - change the current directory

mkdir directory - creates new directory

rmdir directory - Deletes the specified directory, provided it is already em

chown username.group file(s) - Transfers the ownership of a file to the user with the specified user name

chmod mode file(s) - Changes the access permissions

tar options archive file(s) - puts files into archive

2. System commands

date - display the date df - display total disk space df -H - shows the number of occupied blocks in gigabytes, megabytes, or kilobytes df -t - Type of file system (ext2, nfs, etc.) du du - shows the total disk space occupied by files and subdirectories in the current directory du -a - Displays the size of each individual file

3. Network

ip addr show - view all the network addresses

ifconfig - view the network information

ping host - ping a host to test the connection

netstat - view all the connected devices in the network

4. Package Management

apt-get update - refresh available updates

apt-get upgrade - upgrade all the packages

apt-get install - install packages

 

Below mind map shows the most of the commands used in linux environment.


Recent Posts
bottom of page