Linux Commands

File System
df -h
  - Show file sytem usage
 
du -hs
  - Show current folder disc space usage
 
ls | wc -l
  - List number of files and directories for the current folder
 
 

User and Group
grep ^groupname /etc/group
  - List all user of a group

groupadd groupname
  - Create new group

groups
  - List all groups of the current user

htpasswd -c passwdfile username
  - Create password file with username or truncate and rewritten if exists

passwd username
  - Change the password of an exiting user

useradd username
  - Create user

useradd -m -s /bin/bash username
  - Create user with default home folder and bash as default shell

usermod -a -G groupname username
  - Add existing user to an existing group
 

System Inforamtion
uname -mrs
  - Linux kernal version and microprocessor architecture

dmesg
  - Display the boot msg

ps aux OR ps -ef
  - Show running process

netstat -tuna
  - List the listening port

netstat -tulpn | grep :<port>
  - Find the process which occupies a specific port
 

Hard Disk & Partition
e2fsck
  - Checkdisk

fdisk
  - Fixdisk

mke2fs
  - Format hard disk

tune2fs
  - Edit the parameters of the partition
 

Cron Job
crontab -e
  - Edit cron jobs

crontab -l
  - List all cron jobs

select-editor
  - Select text editor for crontab

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s