Top "Unix" questions

This tag is EXCLUSIVELY for PROGRAMMING questions that are directly related to Unix; general software issues should be directed to the Unix & Linux Stack Exchange site or to Super User.

How to concatenate multiple lines of output to one line?

If I run the command cat file | grep pattern, I get many lines of output. How do you concatenate all …

linux bash unix grep tr
How do I list all the files in a directory and subdirectories in reverse chronological order?

I want to do something like ls -t but also have the files in subdirectories included. But the problem is …

unix find ls
How can I use xargs to copy files that have spaces and quotes in their names?

I'm trying to copy a bunch of files below a directory and a number of the files have spaces and …

linux macos unix command-line xargs
Sorting data based on second column of a file

I have a file of two columns and n number of rows. column 1 contains names and column2 age. I want …

bash shell unix
Get specific line from text file using just shell script

I am trying to get a specific line from a text file. So far, online I have only seen stuff …

linux shell unix sh
How to set environment variable for everyone under my linux system?

Can I have certain settings that are universal for all my users?

linux unix bash
Diff files present in two different directories

I have two directories with the same list of files. I need to compare all the files present in both …

unix shell diff
How to get PID of process by specifying process name and store it in a variable to use further?

By using "ucbps" command i am able to get all PIDs $ ucbps Userid PID CPU % Mem % FD Used Server Port ========================================================================= 512 5783 2.50 16.30 350 …

unix process pid
How to make grep only match if the entire line matches?

I have these: $ cat a.tmp ABB.log ABB.log.122 ABB.log.123 I wanted to find a exact match of …

shell unix grep
How to comment out particular lines in a shell script

Can anyone suggest how to comment particular lines in the shell script other than #? Suppose I want to comment five …

shell unix sh