User Tools

Site Tools


console_operations_with_files

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

console_operations_with_files [2018/02/03 17:58] (current)
Line 1: Line 1:
 +**How to find and move files with same extension to different location, in Lubuntu?**
 +
 +first, find:
 +
 +<​code>​find /​home/​zorro/​videos -name \*.avi</​code>​
 +
 +then, change rights, if necessary
 +
 +<​code>​find . -name \*.avi -exec chmod 777 {}  \;</​code>​
 +
 +then, find and move
 +
 +<​code>​find . -name \*.avi -exec mv {} /​home/​zorro/​output/​ \;</​code>​
 + 
 +
 +enjoy
 +
 +
 +
 +**How to find in directory files which were added during last year and copy them to another directory?​**
 +
 +// find from current directory files which were modified last year and list them aka "ls -l"
 +<​code>​
 +find . -mtime -365 -ls
 +</​code>​
 +
 +
 +// find and copy them to "​my"​ folder
 +<​code>​
 +anton@LNX-LABRA:​~/​kicad-libs$ find . -mtime -365 -exec cp {} my \;
 +cp: omitting directory ‘.’
 +cp: omitting directory ‘./my’
 +cp: ‘./​my/​mic5201.lib’ and ‘my/​mic5201.lib’ are the same file
 +cp: ‘./​my/​screwpole.mod’ and ‘my/​screwpole.mod’ are the same file
 +cp: ‘./​my/​mylib.bak’ and ‘my/​mylib.bak’ are the same file
 +cp: ‘./​my/​mcp2200.bak’ and ‘my/​mcp2200.bak’ are the same file
 +cp: ‘./​my/​lcd16x2.dcm’ and ‘my/​lcd16x2.dcm’ are the same file
 +...
 +anton@LNX-LABRA:​~/​kicad-libs$
 +</​code>​
 + 
 +ps. I copied my libraries that I created during last year and separated them from many others
 +
 +**Some console commands**
 +
 +
 +
 +
 +listings
 +
 +list directory with rights and file size:
 +<​code>​
 +ls -l
 +</​code>​
 +
 +list mounted drives with free space in Human readable mode
 +<​code>​
 +df -h
 +</​code>​
 +
 +list size of directories
 +<​code>​
 +df -h
 +</​code>​
  
console_operations_with_files.txt · Last modified: 2018/02/03 17:58 (external edit)