In this article we are going to discuss on some most frequently used basic Linux commands with examples. This article is mainly useful for beginners who just started to learn Linux or want to learn Linux. In this topic we have included all those basic Linux commands by which you can easily operate Linux operating system easily from terminal.
So let’s have a look at basic Linux commands with examples
To list files and directories in Linux we can use ls command. Refer the command below.
elinuxbook@ubuntu:~$ ls
app Desktop Documents Downloads file.txt Music Pictures Public Templates Videos
List files & Directories with some important details like Permissions, Owner, Symlink & Hardlink details, Created Date, File & Directories name.
elinuxbook@ubuntu:~$ ls -l
total 36
drwxrwxr-x 3 elinuxbook elinuxbook 4096 Aug 20 2017 app
drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Desktop
drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Documents
drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Downloads
-rw-rwxrwx 1 elinuxbook elinuxbook 0 Feb 20 09:40 file.txt
drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Music
drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Pictures
List Hidden files & directories.
elinuxbook@ubuntu:~$ ls -a
. .bash_history .cache Desktop Downloads .gnupg .lesshst Music .profile .sudo_as_admin_successful .Xauthority
.. .bash_logout .compiz .dmrc file.txt .HipChat .local Pictures Public Templates .xsession-errors
app .bashrc .config Documents .gconf .ICEauthority .mozilla .pki .QtWebEngineProcess Videos .xsession-er
List files & directories with it’s Inode number.
elinuxbook@ubuntu:~$ ls -li
total 36
284379 drwxrwxr-x 3 elinuxbook elinuxbook 4096 Aug 20 2017 app
278746 drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Desktop
278760 drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Documents
278757 drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Downloads
134040 -rw-rwxrwx 1 elinuxbook elinuxbook 0 Feb 20 09:40 file.txt
278761 drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Music
278762 drwxr-xr-x 2 elinuxbook elinuxbook 4096 Aug 20 2017 Pictures
elinuxbook@ubuntu:~$ mkdir data
3. Delete a Directory
Delete a directory using rmdir command.
elinuxbook@ubuntu:~$ rmdir data
4. Remove/Delete a file
Delete a file using rm command.
elinuxbook@ubuntu:~$ rm file.txt
To delete a directory with content we have to use rm command with argument -rf to delete it forcefully.
elinuxbook@ubuntu:~$ rm -rf data
Read Complete Story
http://www.elinuxbook.com/28-most-frequently-used-basic-linux-commands-with-examples/