| Display Current Working Directory |
pwd |
| Change Current Working Directory |
cd /path/to/directory |
| Show All Files in Current Directory (Including Hidden Ones) |
ls -la |
| Show Sizes of All Files and Directories in Current Directory |
du -sh * |
| Show Available Disk Space |
df -h |
| Copy File |
cp /source/file /destination/file |
| Move or Rename File |
mv /source/file /destination/file |
| Create Directory |
mkdir myDirectory |
| Delete File |
rm /path/to/file |
| Delete Directory Recursively |
rm -rf /path/to/directory |
| Create Symbolic Link |
ln -s /path/to/target /path/to/symlink |
| Change File Permissions (non-recursive) |
sudo chmod 644 /path/to/file |
| Change File Permissions (recursive) |
sudo chmod -R 644 /path/to/directory |
| Change Owner of File (non-recursive) |
sudo chown user:group /my/path |
| Change Owner of Symbolic Link (non-recursive) |
sudo chown -h user:group /my/symlink |
| Change Owner of Files / Directories (recursive) |
sudo chown -R user:group /my/path |
| Count Files (recursive) |
find /my/path -type f | wc -l |
| List Number of Files (recursive) for Each Subfolder |
find . -type f | cut -d/ -f2 | sort | uniq -c |
| Find Files Older Than a Specified Number of Days (non-recursive) |
find /path/to/directory -maxdepth 1 -mtime +60 -type f -print |
| Find Files Older Than a Specified Number of Days (recursive) |
find /path/to/directory -mtime +60 -type f -print |
| Delete Files Older Than a Specified Number of Days (non-recursive) |
find /path/to/directory -maxdepth 1 -mtime +60 -type f -delete |
| Delete Files Older Than a Specified Number of Days (recursive) |
find /path/to/directory -mtime +60 -type f -delete |
| Show All Disks and Partitions |
lsblk |
| Show File Systems for all Disks and Partitions |
lsblk -f |
| Format Partition with File System |
sudo mkfs -t ext4 /dev/sdf2 |
| Mount Drive |
sudo mount /dev/sdc1 /mnt/mountpoint/ |
| Unmount Drive |
sudo umount /dev/sdc1 |
| Mount USB Stick |
pmount /dev/sdf1 |
| Unmount USB Stick |
pumount /dev/sdf1 |
| Check File System |
sudo fsck -p /dev/sdc1 |