PentOpsVault @syztem4our666

PentOpsVault
Linux

Files and Folders

Linux

Create file

touch [fileName]

Create file (alternative)

echo $null >> [fileName]

Delete file

rm [fileName]

Display file content

cat [fileName]

Display file content (alternative)

echo $null >> [fileName]

Edit text file

vi [fileName]

Edit text file (alternative)

nano [fileName]

Edit text file (another alternative)

emacs [fileName]

Edit text file (yet another alternative)

pico [fileName]

Edit text file (minimalist option)

ed [fileName]

Copy file or folder

cp [fileName] [newFileName]

Copy file or folder (alternative)

cat [fileName] > [newFileName]

Copy file or folder (another alternative)

dd if=[fileName] of=[newFileName]

Move/Rename file or folder

mv [fileName] [newFileName]

Create folder

mkdir [folderName]

Delete folder

rm -r [folderName]

List folder contents

ls

List folder contents (alternative)

dir

Change folder

cd [path]

Change to user's home directory

cd ~

Change to parent directory

cd ..

Change to previous directory

cd -

Show current folder

pwd
ln [fileOrigin] [linkDest]

Find phrase within file

grep [phrase] [fileName]

Get filesystem of partition

file -sL [partition]

Mount filesystem

mount /dev/[device] [path]

Unmount filesystem

umount [path]

Make file executable

chmod +x [file]

Show size of all subdirectories

du -h --max-depth=1

Display and update information of files (like top)

watch -d -n 2 'df; ls -FlAt;'

List trash files

ls -l ~/.local/share/Trash/files

List trash files (alternative)

trash-list

Empty trash

rm -r ~/.local/share/Trash

Empty trash (alternative)

gio trash --empty

Empty trash (another alternative)

gvfs-trash --empty

Empty trash (yet another alternative)

trash-empty

Move file to trash

gio trash [file]

View file permission

ls -l [file]

Set file permission

chmod [permission] [file]

View owner and group of file

ls -l [file]

Change owner of file

chown [user] [file]

Change group ownership of file

chgrp [group] [file]

On this page

Edit on GitHub