From the command line
ls * | grep -v [pattern to ignore]
orls [!pattern to ignore] *
in a bash script it may look like this,
for i in `ls * | grep -v [pattern to ignore]`
do
do something here
done
ls * | grep -v [pattern to ignore]
orls [!pattern to ignore] *
in a bash script it may look like this,
for i in `ls * | grep -v [pattern to ignore]`
do
do something here
done
find /tmp/ -type f -mtime +7
Show files older than 7 days and rm them.find /tmp/ -type f -mtime +7 -exec rm {} ;
or if you have a large number of filesfind /tmp/ -type f -mtime +7 | xargs rm
:%s/[ctrlkey+v and ctrl-key+M]//g
actual command,:%s/^V^M//g
Here’s a walk through video I made. My first actually
~# more /proc/sys/fs/file-max
~# 8192
or~# sysctl -a | grep fs.file-max
~# fs.file-max = 8192
2. View how many open file descriptors are currently being used.~# more /proc/sys/fs/file-nr
~# 8191
3. View how many files are open. The number returned might defer as 1
file descriptor can have multiple open files attached to it.~# lsof | wc -l
~# 10325
4. Edit the kernel paramneter file /etc/sysctl.conf and add line “fs.file-max=[new value]” to it.~# vi /etc/sysctl.conf
fs.file-max = 331287
5. Apply the changes.~# sysctl -p
~# fs.file-max = 331287
Problem fixed.
echo "TMOUT=300 >> /etc/bashrc
echo "readonly TMOUT" >> /etc/bashrc
echo "export TMOUT" >> /etc/bashrc
Log off, start a new session and wait for 5 minutes. Your session should terminate
"date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]"
line in the man page.#date -s "7 April 2008 20:42:45"
#date 040720422008.45
[root@klmsyslog01p ~]# date -s "7 April 2008 20:42:45"
Mon Apr 7 20:42:45 MYT 2008
[root@klmsyslog01p ~]#
[root@kmmserver01p ~]# date 040720422008.45
Mon Apr 7 20:42:45 MYT 2008
[root@kmmserver01p ~]#