DEV Community

Rupa Kumari
Rupa Kumari

Posted on

3. Linux commands

who

  • Login name of user
  • Date and time of login
  • remote host name of user

whoami

  • Display system's username

id

  • Displays user identification (real and effective group ids)

groups

  • Displays the groups for which user belongs

Ways to become sudo user in Linus OS

  1. sudo -i
  2. sudo -s
  3. sudo su -
  4. su -root
  5. su -

users

  • Displays username of all users currently logged in

clear

lastlog

  • detail of recent logged in user

File and Directory commands:

pwd

  • present working directory

ls

  • list directories

mkdir

  • create directory

rmdir

  • remove directory

-p : refers for parent
-v : verbose output for the processed direct

touch

  • create file

/ root diretory
~ home directory

Installing packages
yum install package_name

Info about package
yum info package_name

Remove package
yum remove package_name

Installing package from a localfile
./filename

Disk usage command
du pathofdirectory

  • find out disk usage summary

du -h pathofdirectory

  • bring info in human readable format

du -sh nameofdirectory

  • find out total disk usage

ah -sh nameofdirectory

System and hardware information

uname -a

  • all user

uname -s

  • know kernel name

uname -r

  • release of kernel

uname -m

  • print architecture

uname -o

  • print operating system name

Top comments (0)