Tag Info

Hot answers tagged

10

The -s option for du will give you an output which is just the summary, so swap your command to: du -sh /path/to/directory


9

The simplest and cleanest way in my opinion would be to use this command: find . -type f -exec mv --backup=numbered {} . \; && find . -maxdepth 1 -type d -exec rm -r {} + find command #1: .: searches in the current working directory; -type f: searches for files; -exec [...]: executes either a command for each result (using {} [...] \;) or a ...


8

You can use: du -d 0 -h directoryname From man du: -d, --max-depth=N print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument; If you want a GUI application to do that, you can use Disk Usage Analyzer (or baobab), to check: Or use the 'Properties' feature (in most file ...


6

A simple enough bash way: for i in *_date do mv "$i" "${i%%_date}" done ${i%%_date} removes a trailing _date from the string in i.


5

To move all files recursively in the current directory, note that this will move all files into this directory (not their parent directories) : find . -type f -exec mv -i -t . {} + Instead of -i you can use --backup=numbered as shown already by @kos. To remove all empty directories : find . -type d -empty -delete Read man find to get more idea.


3

You can search within each particular archive type as follows: cd /dir/where/you/want/to/start/search find . -iname '*.zip' -exec unzip -l {} \; | grep 'file_pattern' find . -iname '*.tar.gz' -exec tar tvf {} \; | grep 'file_pattern' find . -iname '*.7z' -exec 7z l {} \; | grep 'file_pattern' You could simplify its use by always search starting in the ...


2

Considering a unique folder where you add files often. Build a script (Python and Bash are good options) that loops for folder size every 'n' seconds (or minutes, how often do you add files?). Whenever a new file is created, the size will change and the script should trigger a function that search the last file added and get necessary file info and ...


2

1st off: if you want to hide a file from anyone: install a linux intrusion detection system. (Snort is an example) You can even hide a file from "root" but "root" will also be able to revert those setting. But it might be easier to just set the permissions of the directory that holds the file to "root". Example: $ sudo su # mkdir tmp/ # touch tmp/1 ...


2

Mind that this will copy also folders containing just folders, and not just folders containing at least one file. Not sure if that's exactly what you're looking for; in any case I'll leave this in case it could be useful to someone else. Using find: find source -mindepth 2 -maxdepth 2 -type d -not -empty -exec mv {} target \; source: searches in source/ ...


2

This should do the trick for you: find . -type f -exec mv --backup=numbered "{}" . \; && find . -type d -empty -delete It's 2 find commands the first one finds and moves the files, the second one will only run if the first command is successful and will remove the directories. Thanks to Rinzwind for pointing out the danger of duplicate filenames, ...


1

This should get you going. zenity has many more applications beyond the scope of your question; customize this as you like. #!/bin/bash ls -1 ./FolderA | sort > FolderA.txt ls -1 ./FolderB | sort > FolderB.txt FILESTOCOPY=$(diff FolderA.txt FolderB.txt | grep \< | awk '{print $2;}' | zenity --list --title="Select files to be copied" --co$ echo ...


1

Warning: this is for bidirectional syncing, but given that you are ok in doing things manually... I do not know if there is an option for unidirectional behavior in unison --- if anyone knows please feel free to edit this answer. Install unison: sudo apt-get install unison unison-gtk Create this file in the directory $HOME/.unison, call it test.prf (or ...


1

Another (python) option, offering a bit of a "fancy" report: ---------------------------------------------------------- Newly copied from /home/jacob/map 1 to /home/jacob/map 2: - Naamloos document - pscript_2.py - test123 - monkey_out.txt ---------------------------------------------------------- Unique files in /home/jacob/map 2: - file_in_targetfolder ...


1

From Settings -> Displays; There is a place that named "Scale for menu and title bars" or "UI scale" You can use there. One more option unity-tweak-tool; To install; sudo apt-get install unity-tweak-tool To Run from terminal ; unity-tweak-tool



Only top voted, non community-wiki answers of a minimum length are eligible