Linux Commands: The Good, the Bad

 Linux Commands:Part3

Summary:

who
w
whoami
whereis
date
df
du
hostname
man
ps
kill
top
zip
tar
unzip


who
The who command is used to get information about currently logged in user on to system.

who -u : To show list of users logged in to system
who -r : To display current run level of the system
who -H

w
w command in Linux is used to show who is logged on and what they are doing.
w -h: This option don’t print the header.
w -r: This option will ignore the username.
w -s: This option uses the short format.

whoami
displays the current user info who is logged into perticular linux server

whereis
find the location of source/binary file of a command and manuals for specified file.

-b  binaries
-m  manuals
whereis mkdir
whereis java

date
print or set the system date and time.

df
how much space is available on a particular file system or
disk space usage on lunux file system.

df
df -h : Human readable formar.

du
du command, short for disk usage, is used to estimate file space usage

get inside any direcory and check
du chandra/cst
du -s chandra ; summary
du -hs chandra  summary+human readable format

hostname
show or set the host name.
as a root user set the hostname.

login with root sudo su -
hostname chandrasekhar.com
hostname -i

man
display online manual page
man ls
man mkdir
man man

ps
display the current process running
ps
ps -ef : display process other users also
ps -ef | grep java : find out java process id
ps -ef | grep jenkins : dsiplay jenkins process id
ps -ef | grep tomcat

kill
kill the process

top
dsiplay the linux tasks
cpu,ram utilization use thi cmd.

zip
ZIP is a compression and file packaging utility for Unix.
Each file is stored in single .zip {.zip-filename} file with the extension .zip.
zip myfile.zip filename.txt

unzip myfile.zip
unzip myfile.zip

tar [options] [archive-file] [file or directory to be archived]
-c : Creates Archive
-x : Extract the archive
-f : creates archive with given filename

tar cvf states.tar chandra/
tar -cvf states.tar chandra/
tar -xvf states.tar

Chandra Sekhar

A Blogger and Author! This post was written and edited by me, a technologist. I started this site to share my inspirations, work, and free materials, which I hope others may find useful as well. Man with a creative streak who enjoys experimenting with various web design strategies.

Previous Post Next Post

Microservice Communication in a Distributed System