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