Skip to content
Advertisement

Tag: command-line

Adding server hostname to each line of ‘find’ output

I am in need of a listing of all files with a specific extension on a server. I need it to show the server hostname, file size, and absolute path of the file. or Almost get me there: joes_server 5473 /home/joe/pics/sunset.jpg 8522 /home/joe/pics/mountains.jpg I cannot figure out how to include the hostname on each line of the find output. My

How to list recently deleted files from a directory?

I’m not even sure if this is easily possible, but I would like to list the files that were recently deleted from a directory, recursively if possible. I’m looking for a solution that does not require the creation of a temporary file containing a snapshot of the original directory structure against which to compare, because write access might not always

Python command line arguments linux

I have this little program(I know there is a lot of errors): If i start it by typing python file.py testfile.txt the output will be always(even if the file doesn’t exist): If you don’t know what iam want from this program, i want to print “File ‘filename’ wasn’t found” if the file isn’t exist and if it’s exist iam wan’t

How to enable confirmation alert when using ‘rm’ command to delete files / folders? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

Merge multiple files preserving the original sequence in unix

I have multiple (more than 100) text files in the directory such as The contents of the file are name of some variables like files_1_100.txt contains some variables names between 1 to 100 Similarly files_201_300.txt contains some variables between 101 to 200 and files_1001_1100.txt as I can merge them using the command However, the contents of files does not follow

How to find newest files with a certain name?

Suppose I have a directory with many files of the same name in subdirectories (for example, comes up when keeping BibTeX files for multiple academic papers). What’s the best way to find the newest version of a file with a given name? I’ve come up with the following command which lists all the files named someFile along with their dates,

Advertisement