With a find command, I can display directories names with multiple levels. The following command display all directories under /var path with a depth of 2: The result shows: With a stat command, I can find the modified date time: The result is: Is there a way to combine the two commands so that directories will be listed with modified
Tag: command-line
How to view the list of c library functions in Linux? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question I’m a newbie in Linux programming. I found that the way
Number of processors/cores in command line
I am running the following command to get the number of processors/cores in Linux: It works but it does not look elegant. How would you suggest improve it ? Answer nproc is what you are looking for. More here : http://www.cyberciti.biz/faq/linux-get-number-of-cpus-core-command/
Delete files older than X minutes
I would like to delete files that are older than 59 minutes. I have this so far: This doesn’t work and seems to delete all files. I’ve tested this several times and I think the issue is to do with daystart. I’ve read the man page and it seems to base time on the beginning of the day rather than
Backspace in zsh fails to work in quite the strange way
I’m on a fresh Virtualbox install of CentOS 6.4. After installing zsh 5.0.2 from source using ./configure –prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good. Then some time after, after installing python it seems, it starts acting strange. Happens with PuTTY and iTerm2 over SSH, does not happen on
calculate total used disk space by files older than 180 days using find
I am trying to find the total disk space used by files older than 180 days in a particular directory. This is what I’m using: but the above is quiet evidently giving me disk space used by every file that is found. I want only the total added disk space used by the files. Can this be done using find
bash: grep exact matches based on the first column
I have a .txt file like below: For example, I want to generate a subset with the IDs 4324321_A3 and 9342432 (based on the first column!). I tried the following command to find the exact matches: But when I use this line, I end up with a dataset like this: The problem is that the line that matches a part
In reverse-i-search (Ctrl+R ) ,Any method to switch between similar commands in history
I think an example will be good to understand my question. Assume that is the order of commands in history. If I am doing Ctrl+R and type scp it will show the last executed scp command ( ie the line ending with ‘tested’) . But I want to locate the scp command ending with ‘important’. So is there any way
getting pid of spawned exec in phing
I am using phing and running selenium server via ExecTask. Sometimes I need to stop running server by killing its process. Is there a possibility in phing of getting PID of process spawned in ExecTask ? Answer No, ExecTask cannot give the pid of spawned processes directly. It can only return it’s exit status and output. Maybe you can modify
Track the time a command takes in UNIX/LINUX?
In UNIX/LINUX, is there an easy way to track the time a command takes? Answer Yes, use time <command>, such as Consult man time for more options. Link.