Summary:
To find the PID of a running UNIX/XWindow process:
$ xprop _NET_WM_PID
If that fails:
$ ps -ww -fp <PID>
$ pwdx <PID>
Detailed explanation:
So How can you find the PID (not Window ID!) of a running UNIX/XWindow process?
Method 1 (simple):
$ xprop […]
Being able to see seconds in the UNIX ‘ls’ command is particularly useful for comparing/viewing recently created files, because by default ‘ls -l’ will simply show “Today” in the date/time field for such files.
Here’s how you can make ‘ls’ show also the seconds (and not only seconds but also microseconds, for that matter… […]
Using Kdiff3 tool as example action to add to the SendTo menu of Thunar.
Create the following file in ~/.local/share/Thunar/sendto and name it <whatever>.desktop (I named mine ‘kdiff3.desktop’) :
# kdiff3.desktop – Integrate kdiff3 into
# the “Send To” menu.
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
TryExec=kdiff3
Exec=kdiff3 %F
Problem:
A site contains data which is of interest to us. The data is uniformly structured and available for examination by the general public (i.e. no login required) but is not automatically accessible, i.e. viewing it requires repetitive user interaction (such as setting a date range, clicking a ‘submit’ button, etc). In addition, usually the […]
Use imagemagick – this is exactly what it was designed for! 🙂
For example:
– to resize all .jpeg files in the current directory to be 320 pixels wide, preserving the aspect ration, do this:
 $ convert ‘*.jpeg[320x]’ resized%03d.jpeg
– to shrink all .jpg files in the current directory […]
find ~ -type f -name “.*” FIND the hidden files in your home directory (~) find . -name *~ -type f -delete Delete all files ending in ~ find . -name *.svn -type d -print0 | xargs -0 /bin/rm -rf Delete all .svn files under current dir find . -name *.c -perm /u+x -type f […]
Here’s how to list all packages whose names start with ‘nss’
yum info -v nss* | grep -v Committer | grep -w ‘Name\|Version\|Release\|Description\|Repo’
Here’s how to list all INSTALLED packages whose names start with ‘nss’
yum info -v nss* | grep -A12 -B5 -w ‘installed’ | grep -v Committer | grep -w ‘Name\|Version\|Release\|Description\|Repo\|installed’
And since […]
I don’t know about the other people but to me the scariest UNIX command is by far sed. Today I found myself in a situation where I found no other way to solve my problem but to use sed… and it worked… and was not all that scary 🙂
I needed to replace a bunch […]
Creating this post to dump here various bash shell and script commands, tips and tricks which I found useful in my everyday work. Will update it with new info continually…
———
Check in bash if a file exists or not and do something in each case:
if [ -f $FILE ]; then echo […]
Often times, when working with the standard Linux/UNIX time format (time_t) one needs to quickly find out what is the “human readable” date and time text string a particular time_t value corresponds to.
NOTE: The ‘C’ time_t type is the number of seconds elapsed since the “epoch”, the epoch being January 1st 1970 at 00:00:00.
[…]
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Calendar
September 2023 M T W T F S S « Aug 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum