What does TTY mean in the unix ps command?

A TTY is a computer terminal. In the context of ps, it is the terminal that executed a particular command. The abbreviation stands for “TeleTYpewriter”, which were devices that allowed users to connect to early computers. In relation to your situation, the jar creates a virtual terminal named ‘ttys000’ but the IDE does not attach … Read more

Using bash ps and cut together

ps is printing out space separators, but cut without -d uses the tab character. The tr -s squeezes the spaces together to get more of the separation that you want, but remember that there is the initial set of spaces (squeezed to one) hence why you need to add 1 to each field. Also, there … Read more

Matplotlib Plots Lose Transparency When Saving as .ps/.eps

The problem is that eps does not support transparencies natively. There are few options: rasterize the image and embed in a eps file (like @Molly suggests) or exporting to pdf and converting with some external tool (like gs) (which usually relies as well on rasterization) ‘mimic’ transparency, giving a colour that looks like the transparent … Read more

Counting open files per process

Have a look at the /proc/ file system: ls /proc/$pid/fd/ | wc -l To do this for all processes, use this: cd /proc for pid in [0-9]* do echo “PID = $pid with $(ls /proc/$pid/fd/ | wc -l) file descriptors” done As a one-liner (filter by appending | grep -v “0 FDs”): for pid in … Read more

How to get pid given the process name

I think it is easier to use pgrep $ pgrep bluetoothd 441 Otherwise, you can use awk: ps -ef | awk ‘$8==”name_of_process” {print $2}’ For example, if ps -efhas a line like: root 441 1 0 10:02 ? 00:00:00 /usr/sbin/bluetoothd Then ps -ef | awk ‘$8==”/usr/sbin/bluetoothd” {print $2}’ returns 441. In ksh pgrep is not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)