Files/Folders

Create file

>_ touch [fileName]
copy
>_ echo $null >> [fileName]
copy

Delete file

>_ rm [fileName]
copy

Display file content

>_ cat > [filename]
copy
>_ echo $null >> [filename]
copy

Edit text file

>_ vi [fileName]
copy
>_ nano [fileName]
copy
>_ emacs [fileName]
copy
>_ pico [fileName]
copy
>_ ed [fileName]
copy

Copy file or folder

>_ cp [fileName] [newFileName]
copy
>_ cat [fileName] > [newFileName]
copy
>_ dd if=[fileName] of=[newFileName]
copy

Move/Rename file or folder

>_ mv [fileName] [newFileName]
copy

Create folder

>_ mkdir [folderName]
copy

Delete folder

>_ rm -r [folderName]
copy

List folder contents

>_ ls
copy
>_ dir
copy

Change folder

>_ cd [path]
copy

Change to users home directory

>_ cd ~
copy

Change to parent directory

>_ cd ..
copy

Change to previous directory

>_ cd -
copy

Show current folder

>_ pwd
copy

Create a physical link to file or folder

>_ ln [fileName] [linkName]
copy

Find phrase within file

>_ grep [phrase] [fileName]
copy

Get filesystem of partition

>_ file -sL [partition]
copy

Mount filesystem

>_ mount /dev/[device] [path]
copy

Unmount filesystem

>_ umount [path]
copy

Make file executable

>_ chmod +x [file]
copy

Show size of all sub directories

>_ du -h –max-depth=1
copy

Display and update information of files(like top)

>_ watch -d -n 2 ‘ df; ls -FlAt;’
copy

List trash files

>_ ls -l files ~/.local/share/Trash/files
copy
>_ trash-list
copy

Empty trash

>_ rm -r ~/.local/share/Trash
copy
>_ gio trash --empty
copy
>_ gvfs-trash --empty
copy
>_ trash-empty
copy

Move file to trash

>_ gio trash [file]
copy

View file permission

>_ ls -l [file]
copy

Set file permission

>_ chmod [permission] [file]
copy

View owner and group of file

>_ ls -l [file]
copy

Change owner of file

>_ chown [user] [file]
copy

Change group owner ship of file

>_ chgrp [group] [file]
copy
Copied to clipboard
free 100$ digital ocean credit