Skip to main content

Miscellaneous

Move multiple files using mv command​

Move multiple files from a folder to another folder in Linux using 'mv' command

mv -t DESTINATION file1 file2 file3

Example: mv -t ./Other final_doc1.odt filenames.txt new_wall.jpg


Get full path of a file in terminal​

Use realpath command

Example: realpath auto.sh

output: /home/appuser/Desktop/scripts/auto.sh


Check size of files in a directory​

ls -lh

Sample Output:

total 3.2G
-rw-rw-r-- 1 appuser appuser 125K Feb 6 11:27 biology.jpeg
drwxrwxr-x 6 appuser appuser 4.0K Jun 20 10:10 ImageResize
-rw-rw-r-- 1 appuser appuser 58 May 21 10:55 path.txt
-rw-r--r-- 1 appuser appuser 3.2G Jun 25 09:52 data.zip
-rw-rw-r-- 1 appuser appuser 145K Jun 2 14:54 screenshot.png