Tag: file

SCP Copy from Remote to Local System

Copy files/folder from a remote server to this system. scp -r binnyva@ .

Copy Files using SCP

Copy files/folder to a remote server. scp <file> binnyva@ scp -r <folder> binnyva@

List of Open Files

Display a list of files opened by processes lsof -p NUMBER

Find Open File in a Given Directory

Find the process that’s opened the file from a specified directory. You can use this if you cannot unmount a…

Write and Append Permission

Allows write opening of a file only append mode chattr +a file

Compare contents of two files

Compare contents of two files by deleting only unique lines from ‘file1’ comm -1 file1 file2

Copy all Txt Files

Find and copy all files with ‘.txt’ extention from a directory to another find /home/binnyva -name ‘*.txt’ | xargs cp…

Sort and Unique

Sort contents of a file and remove repeated lines sort file.txt | uniq

View some lines in a file

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

Encrypt/Decrypt using GPG

Encrypt/Decrypt a file with GNU Privacy Guard – GPG. #Encrypt gpg -c file #Decrypt gpg file.gpg