Top Banner
Useful Linux Commands -- Deepak Modak
15

Useful Linux Commands

Feb 10, 2015

Download

Education

Deepak Modak

It's a collection of some lesser known but useful Linux commands. All are "Swiss army knife" one-liners which every Linux user should know.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Useful Linux Commands

Useful Linux Commands

-- Deepak Modak

Page 2: Useful Linux Commands

bc An arbitrary precision calculator language

Page 3: Useful Linux Commands

cat - concatenate files and print on the standard output

tac - print files in reverse

Eg : cat filename

tac filename

Page 4: Useful Linux Commands

ls - list directory contents

sl - display animations aimed to correct users who

accidentally enter sl instead of ls.

* sl is not a linux command , need to install package

Page 5: Useful Linux Commands

file - determine the type of file

stat - display file or file system status

Eg : file filename

stat filename

Page 6: Useful Linux Commands

factor

Print the prime factors of each specified integer

Eg : factor 18

Page 7: Useful Linux Commands

sudo !!

Run the last command as root. It automatically prepend sudo to the last command entered.

Page 8: Useful Linux Commands

cd –change to the previous working directory

Page 9: Useful Linux Commands

man ascii

Quick access to the ascii table.

Page 10: Useful Linux Commands

curl ifconfig.me

Print external IP address

Page 11: Useful Linux Commands

wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com

The non-interactive network downloader It will download all files, including images mozilla as browsers

identity .

Page 12: Useful Linux Commands

Ctrl-l

Clear the terminal screen

Page 13: Useful Linux Commands

du -h –max-depth=1List the size of all sub folders from the current location

Ihuman readable form

du | sort -nr | less

List of files and folders, sorted in descending order by size.

Page 14: Useful Linux Commands

python -m SimpleHTTPServer

Serve current directory tree on port 8000. http://localhost:8000/

Page 15: Useful Linux Commands

# Tag

Hash tags to organize bash history and very good for finding very long commands

Step : • Just add a hash tag in every command you type at the end,• Later can search for the hash tag in reverse-i-search (Ctrl + R).

Eg: $ tar -xzvf filename #untarNow, just Ctrl + R, and type untar and you get the command!

# in shell means a comment.