Posted: . At: 1:51 PM. This was 8 years ago. Post ID: 9819
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to list the installed files of a certain package and other useful tips.

To list all the files installed by a certain Debian package, use this command. dpkg -L [PACKAGENAME].

For example.

ubuntu ~ $ dpkg -L vim
/.
/usr
/usr/bin
/usr/bin/vim.basic
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/vim
/usr/share/bug
/usr/share/bug/vim
/usr/share/bug/vim/presubj
/usr/share/bug/vim/script
/usr/share/doc
/usr/share/doc/vim

Pick a random directory in your home directory..

ubuntu ~ $ ls -d */ | shuf -n 1

This is another way to pick a random directory to list.

ubuntu ~ $ dirs=(`ls -d */`); printf "%s\n" "${dirs[RANDOM % ${#dirs[@]}]}"

How to print the directory tree to the preceding directory with the Linux command line.

ubuntu ~/Documents $ echo ${OLDPWD}
/home/ubuntu

This is another way to see where you are in the directory stack.

ubuntu ~/Documents $ echo $DIRSTACK
~/Documents

How to read a text file from the bottom up.

ubuntu ~ $ sort -nr < /usr/share/doc/vim/copyright

List the contents of a directory listing from the bottom to the top.

ubuntu ~/Documents $ ls | sort -nr
virii.S
system.save
SYSTEM
security.save
SECURITY
secretsdump.py
sam.save
SAM
recipe-502268-1.py
python
nikto-pinterest-log.log
my.c
impacket-read-only
hole.o
hashes.out
crackstation.txt
a.out

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.