Tag: Linux

Make a File Immutable

Makes a file immutable – it can not be removed, altered, renamed or linked chattr +i file

View some lines in a file

View from 1th to 5th line sed -n ‘1,5p;5q’ example.txt

Move Subfolder Files to Current Folder

This command moves all the files in the subfolder to the current folder. mv */* .

Fish Shell Command History Meme

Use this command if you want to know your command usage stats in the fish shell. grep -v “^\#” “.config/fish/fish_history”|awk…

Remove all EXE files

Removes all exe files in the current directory tree. Useful to clear virus from flash drives. find . -name “*.exe”…

First Two Lines

View first two lines of a file head -2 file tail -2 file # for last 2 lines

fsck command

Repair / check integrity of linux filesystem on disk hda1 fsck /dev/hda1

Grep using Sed

View only lines that contain the word “string” sed -n ‘/string/p’

Schedule a Download

Start a download at any given time echo ‘wget -c www.example.com/files.iso’ | at 09:00

Kernel Version

Get the version of the kernal cat /proc/version OR uname -r