Files opened by user in specified directory

Find files used by a user in a folder

View user activity per directory. lsof -u someuser -a +D ./ View all files opened by a user in specified directory. The +D option makes lsof search all sub-directories to complete depth, while ignoring symbolic links. OUTPUT: COMMAND PID USER FD TYPE DEVICE SIZE/OFF   ..

Delete thunderbird msf file in linux

Find and delete thunderbird's msf file

Find and delete thunderbird's msf files to make your profile work quickly again. find ~/.thunderbird/*.default/ -name *.msf -exec rm -f {} \; Find command will find the msf file from the specified home directory or location and the exec command will remove the file found by using find command.   ..

List alive hosts in specific subnet nmap command

Find alive systems in network

nmap Command to list the system on network connection nmap -sP OUTPUT: Starting Nmap 4.68 ( ) at 2010-06-06 20:38 IST Host ( appears to be up. Host ( appears to be up. Nmap done: 256 IP addresses (2 hosts up) scanned in 1.144 seconds The nmap command will list number of host  ..

Create a temporary file or directory

Command to create temp file or directory

Linux Command to create temp file tempfile=$(/bin/mktemp) Linux Command to create temp directory tempdir=$(/bin/mktemp -d)   ..

How to disable users list on gdm login

Display off valid users on the workstation

If you dislike Fedora's default behaviour of showing all the valid users on the workstation during a X-windows login this will make the user type a userid and password. gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/gdm/simple-greeter/disable_user_list true   ..

Find package version on debian linux

Debian linux version

Find a Package Version on Debian based distribution dpkg-query -W -f='${Version}\n' package-name The command will query the package list of debian packages and will list the distribution.   ..

Find files and list then sort by modification time

List files with modified time

find . -type f | xargs ls -ltrhg find and list normal files and list them sorting with modification time without group l: with detailed information t: sort with modification time r: reverse order h: show file's size in human-readable format, such as K(kilobytes), M(megabyes) etc. g: do not show group   ..

Find linux distribution installed on your machine

Display which distro is installed

How to find linux distribution installed on your machine? cat /etc/*release Output Fedora release 10 (Cambridge) Fedora release 10 (Cambridge) Fedora release 10 (Cambridge) This command works in all all linux distros.  ..

Reverse a file using tac command

Print a file as seen in mirror

How do I print a file in reverse order? tac -r -s "." FILENAME Example: Lets consider a file cat for x in $(grep -r "isam" test) do echo $x done tac -r -s "." eno dx$ ohc eo d)tset "masi" r- perg($ ni x ro   ..

Tail command update at specified interval

Tail a file at one line per second

tail -fs 1 somefile The -s option allows you to specify the update interval tail -f somefile | while read line ; do echo $line ; sleep 1; done Tail a file at one line per second. The sleep value 1 in this case controls the update speed of tail -f.   ..

Yum list available packages

Yum command to list packages

yum list available This command will list all the available packages in yum repository How to list just one repo with yum. First I disable all repo, second I enable just the repo that I want to list. yum --disablerepo=* --enablerepo=epel list available   ..

How to display memory usage with ps command

Diaplay memory usage

Find memory usage of a particular process or command by a user ps -o comm,%mem,args -u nobody output: proftpd 0.2 proftpd: (accepting connections) mysqld 1.0 /opt/lampp/sbin/mysqld --basedir=/opt/lampp.... httpd   ..

Redirect all page from one domain to another domain

Tomcat redirect pages

If you want to move all the pages in a particular folder to other domain example to Then to the following changes in your code Step 1: changes your web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="" xmlns:xsi="" xsi:schemaLocation=""> <display-name>Forum Moving </display-name> <servlet> <servlet-name>redirect.jsp </servlet-name> <jsp-file>/redirect.jsp </jsp-file> </servlet> <servlet-mapping> <servlet-name>redirect.jsp </servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> Here I'm redirecting all the request in that webapplication to "redirect.jsp" Setp 2: Create  ..

Linux command to identify the biggest file

Find biggest file

How will you find a huge file on your system du -s * | sort -nr | head The above command will make you to identify the huge file.  ..

Replace argument of the last command

Change the argument of last command

/usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 then !:- is the same as /usr/sbin/ab2 -f TLS1 -S -n 1000 -c 100 -t 2 !:- will Insert the last command without the last argument (bash).   ..

< Previous 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Next >

Tech Bluff