Switching From Windows to Nix or a Newbie to Linux – 20 Use

  

Switching From Windows
to Nix or a Newbie to Linux – 20 Useful Commands for Linux Newbies

1. Command: lsThe command “ls” stands for (List Directory Contents), List the contents of the folder, be it file or folder, from which it runs.root@tecmint:~# ls

Android-Games MusicPictures PublicDesktop Tecmint.comDocuments TecMint-SyncDownloads Templates The command “ls -l” list the content of folder, in long listing fashion.root@tecmint:~# ls -l

total 40588drwxrwxr-x 2 ravisaive ravisaive 4096 May 8 01:06 Android Gamesdrwxr-xr-x 2 ravisaive ravisaive 4096 May 15 10:50 Desktopdrwxr-xr-x 2 ravisaive ravisaive 4096 May 16 16:45 Documentsdrwxr-xr-x 6 ravisaive ravisaive 4096 May 16 14:34 Downloadsdrwxr-xr-x 2 ravisaive ravisaive 4096 Apr 30 20:50 Musicdrwxr-xr-x 2 ravisaive ravisaive 4096 May 9 17:54 Picturesdrwxrwxr-x 5 ravisaive ravisaive 4096 May 3 18:44 Tecmint.comdrwxr-xr-x 2 ravisaive ravisaive 4096 Apr 30 20:50 Templates Command “ls -a“, list the content of folder, including hidden files starting with ‘.’.root@tecmint:~# ls -a

. .gnupg .dbus .goutputstream-PI5VVW .mission-control.adobe deja-dup .grsync .mozilla .themes.gstreamer-0.10 .mtpaint .thumbnails .gtk-bookmarks .thunderbird.HotShots .mysql_history .htaccess .apport-ignore.xml .ICEauthority .profile .bash_history .icons .bash_logout .fbmessenger.jedit .pulse .bashrc .liferea_1.8 .pulse-cookie .Xauthority .gconf .local .Xauthority.HGHVWW .cache.gftp .macromedia .remmina .cinnamon .gimp-2.8.ssh .xsession-errors .compiz .gnome teamviewer_linux.deb .xsession-errors.old .config .gnome2 .zoncolor Note: In Linux file name starting with ‘.‘ is hidden. In Linux every file/folder/device/command is a file. The output of ls -l is:1.d (stands for directory).2.rwxr-xr-x is the file permission of the file/folder for owner, group and world.3.The 1st ravisaive in the above example means that file is owned by user ravisaive.4.The 2nd ravisaive in the above example means file belongs to user group ravisaive.5.4096 means file size is 4096 Bytes.6.May 8 01:06 is the date and time of last modification.7.And at the end is the name of the File/Folder.For more “ls” command examples read 15 ‘ls’ Command Examples in Linux.2. Command: lsblkThe “lsblk” stands for (List Block Devices), print block devices by their assigned name (but notRAM) on the standard output in a tree-like fashion.root@tecmint:~# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 232.9G 0 disk ├─sda1 8:1 0 46.6G 0 part /├─sda2 8:2 0 1K 0 part ├─sda5 8:5 0 190M 0 part /boot├─sda6 8:6 0 3.7G 0 part [SWAP]├─sda7 8:7 0 93.1G 0 part /data└─sda8 8:8 0 89.2G 0 part /personalsr0 11:0 1 1024M 0 rom The “lsblk -l” command list block devices in ‘list‘ structure (not tree like fashion).root@tecmint:~# lsblk -l

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 232.9G 0 disk sda1 8:1 0 46.6G 0 part /sda2 8:2 0 1K 0 part sda5 8:5 0 190M 0 part /bootsda6 8:6 0 3.7G 0 part [SWAP]sda7 8:7 0 93.1G 0 part /datasda8 8:8 0 89.2G 0 part /personalsr0 11:0 1 1024M 0 rom Note: lsblk is very useful and easiest way to know the name of New Usb Device you just plugged in, especially when you have to deal with disk/blocks in terminal.3. Command: md5sumThe “md5sum” stands for (Compute and Check MD5 Message Digest), md5 checksum (commonly called hash) is used to match or verify integrity of files that may have changed as a result of a faulty file transfer, a disk error or non-malicious interference.root@tecmint:~# md5sum teamviewer_linux.deb

47790ed345a7b7970fc1f2ac50c97002 teamviewer_linux.deb Note: The user can match the generated md5sum with the one provided officially. Md5sum is considered less secure than sha1sum, which we will discuss later.4. Command: ddCommand “dd” stands for (Convert and Copy a file), Can be used to convert and copy a file and most of the times is used to copy a iso file (or any other file) to a usb device (or any other location), thus can be used to make a ‘Bootlable‘ Usb Stick.root@tecmint:~# dd if=/home/user/Downloads/debian.iso of=/dev/sdb1 bs=512M; sync Note: In the above example the usb device is supposed to be sdb1 (You should Verify it using command lsblk, otherwise you will overwrite your disk and OS), use name of disk very Cautiously!!!.dd command takes some time ranging from a few seconds to several minutes in execution, depending on the size and type of file and read and write speed of Usb stick.en"],null,[0.98883557],en"]]]

Copyright © Windows knowledge All Rights Reserved