The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

1
vote
1answer
15 views

Change terminal text color for next command only

So when I find myself compiling a lot (from the terminal) I find it difficult to distinguish between the current compilation results and the old ones, so I was wondering if there is a bit of text that ...
1
vote
3answers
42 views

Deleting all files except folders within directory

I am still pretty new to terminal based commands but while I was doing a rsync command between remote and local, I have accidentally 'copied' the files to the wrong place (Eg. /serA/items) instead of ...
2
votes
2answers
57 views

How can I compare two files and create another file that aren't in first file?

file1 contains: 100 200 300 400 file2 contains: 500 600 700 200 300 Expected output file will be: 500 600 700
1
vote
1answer
22 views

OSX: Delete all matching certificates by command-line

Using shell script to delete all matching certificates. I found a list of certificates using: security find-certificate -c "certificatename" -a -Z|grep SHA-1|awk '{ print $NF }' Output is like ...
2
votes
1answer
28 views

Merge text files with 1st column and difference in output file

File 1: (text1.txt) Row_Added_Ts Count 01/01/14 2022448 02/01/14 8345155 03/01/14 8663852 04/01/14 6785739 05/01/14 5279913 File 2: ...
1
vote
3answers
75 views

Is there a way to undo a terminal command?

I just copied a whole directory into another one using cp ~/local/* ./ and actually wanted to type cp ~/local/srl* ./ so I'm founding myself with a lot of unnecessary files. I can suppress them ...
1
vote
2answers
21 views

Can I pipe clipboard content to browser for viewing?

Here is the situation. I often have to read chunks of information from large plain text files. I am planning to use Readability extension for formating the content to make it readable on screen.
0
votes
2answers
28 views

Wrong zip command messed up my project directory

I've issued a command gzip -r project.zip project/* in projects home directory and I've messed things up; every file in project directory and all other subdirectories have .gz extension. How do I undo ...
0
votes
1answer
26 views

extract subfolders outside and rename if necessary

I have a directory looks like: dhcp-18-189-47-44:CE-06-new-stuctures_backup wenxuanhuang$ ls DFT-00001 DFT-00004 DFT-00007 DFT-00010 DFT-00013 DFT-00016 DFT-00019 DFT-00022 DFT-00025 DFT-00028 ...
1
vote
0answers
16 views

List `yum/dnf` history in ascending (reversed) order

When you run yum history (or dnf history) it will give you the list of action starting from the last, most recent action being on top of the list. In case you have a lot of history steps your recent ...
14
votes
2answers
520 views

What does CTRL+4 (and CTRL+\) do in bash?

I just found out by accident that CTRL + 4 closes programs reading stdin input from the command-line. This is how it looks when I type CTRL + 4 or CTRL + / into programs reading stdin ryvnf:~$ ...
1
vote
2answers
54 views

How to use ln -s to create a command line shortcut?

I have an sh file that I would like to be able to open from the terminal at any time. I would like to type "studio" into the terminal, and have android studio open I recall using ln -s to do this, ...
1
vote
3answers
55 views

Command line to go in directory passed by which command

I want use a command such as this : which node && cd $_ to jump in the directory when the binary file reside, but the which command return all the path + name of binary ,so i get an error ...
0
votes
1answer
21 views

How to find what the “Mate version” of programs are called

On Mate systems, many programs correspond to (and are sometimes forks of) other programs with more well-known names: nautilus -> caja gnome-terminal -> mate-terminal ark -> engrampa gedit -> pluma ...
1
vote
2answers
166 views

What command should I use to move these particular elements?

Here is my initial situation: In a folder named for example Father, are stored some files in the following way: Father contains 24 children folders (let's call them Child1, Child2, ...), and each one ...
2
votes
2answers
48 views

adding column in CSV file using awk

I need to a add a column in CSV file from an array using awk. For example, input.csv a,10 b,11 array = (100 200) output.csv should look like a,10,100 b,11,200 I tried this command but it does ...
1
vote
2answers
36 views

linux terminal transfer control to new terminal [closed]

in one of my shell program, I want start an xterm window from terminal and then the control of next execution should go to the newly opened window (by default the control will be in the terminal). ...
0
votes
1answer
25 views

How to run bunch of hierarchical dummy shell processes (process of another process, etc.)?

I would like to run multiple processes where each process is running another one, so it will create a long process branch. I've tried: $ bash -c '(bash -c "sleep 20"); sleep 20' & $ pstree ...
0
votes
1answer
61 views

SED - Find and replace with special characters (#, , % )

I'm aware that this is a really simple question, but I'm struggling to find a solution to this . I need to automatically find and replace in the /etc/aliases file the following section: # Person ...
3
votes
3answers
48 views

Find a pattern and insert # at the beginning of 2 line befoe that and 1 line after that

I have a big file (more than 2000 lines). Where i have to insert a # at the beginning of 2 above lines and at the beginning of 1 below line after finding a pattern. Also insert # at the beginning of ...
5
votes
3answers
127 views

Retreat from deleted directory

Suppose I am editing some files. I have (say) a terminal open and a gui file manager. I am currently in /my/very/long/and/winding/directory/path in the terminal. In my gui, I delete ...
0
votes
1answer
57 views

How to grep the following lines from a file?

I have a file which has the names of many files in a directory in the following format: A20150824.0950-0955_jambala_CcnActiveSessionCounterJob A20150824.0945-0950_jambala_CcnActiveSessionCounterJob ...
2
votes
1answer
33 views

Openssl passing a binary pass phrase as a argument

This openssl command is working fine for me. openssl aes-128-ecb -d -in encrypted_base64.txt -K 4D1D75237C31E7732030C69F209F23154418373335E049C4F567C7B6D422ABD0 -base64 How would I do the ...
0
votes
1answer
13 views

What is the recommended resource to refer to for syntax, usage and information about commands for an application?

What is the recommended resource to refer to for syntax, usage and information about commands for an application? I am currently trying to decide between command help (assuming that command has a ...
1
vote
1answer
34 views

Can install be used to stage symlinks?

Can install be used to install symlinks without dereferencing and installing the target file - it seems like such an unusual omission? drwxrwxr-x 2 greg greg 4096 Aug 20 10:46 . drwxrwxr-x 4 greg ...
0
votes
1answer
45 views

How to boot GUI on a fedora 21 server through the command line

I am trying to install a GUI onto my fedora21 virtual machine. The only problem is due to the nature of work i am doing it needs to be done through the command line( i am using a program called ...
-2
votes
3answers
50 views

Delete subdirectory folder while saving contents

Lets say I have the directory /Users/admin/Documents/Folder1/file1.txt and would like to delete Folder1 without also deleting file1.txt. In the end it should look like ...
2
votes
2answers
55 views

How can I turn `file` tool into a predicate for `find`?

I have something like: find . -type f -print0 | xargs -0 file | grep Matroska | cut -d: -f 1-1 | xargs rm I want something like: find . -type -f -filemagic "Matroska" -delete
3
votes
1answer
47 views

Which device is working

I have one dvb-t and one dvb-s card in my system which are in /dev/dvb/adapter0 and /dev/dvb/adapter1 Is there a way to find out which card is currently working? and which one isn't?
0
votes
0answers
17 views

How do I create a deflate file suitable for HTTP?

Say I have index.html. How do I obtain index.html.deflate appropriate for serving through HTTP with the "deflate" encoding? I am coding a simple web server and I don't want to implement streaming ...
6
votes
1answer
92 views

Start vi at the last line

I often find myself editing one of a set of configuration files by adding lines at the end. For editing I use vi (from bash) and currently use: vi +$(wc -c /home/john/master/tried.cfg) The above ...
3
votes
1answer
71 views

I'm trying to Install Eclipse But When I Try to Run ./configure It Doesn't Work

So I am trying to install Eclipse through terminal by watching a video, but when I attempt to run ./configure I get a message saying bash: ./configure: No such file or directory I looked around ...
0
votes
2answers
51 views

How can i convert 14/Jul/2015 into 14-08-2015 [duplicate]

How can I convert 14/Jul/2015 into 14-08-2015? It is saying invalid date format because of the Jul element, but if I put 07 then it works fine. I tried this: echo "Please enter the date: " read X ...
1
vote
1answer
42 views

Why are arguments of a command altered when viewed by ps?

When I run my favorite app, why the arguments look different when viewed by ps? $ redshift -l 12.94:43.75 2>/dev/null 1>&2 & [1] 8637 $ ps -o cmd= -C redshift redshift -l 12.94 43.75 ...
0
votes
1answer
59 views

Zip the contents of a directory without the directory itself [duplicate]

I want to create a ZIP archive of a directory without going into the directory itself, and not include that directory Zip the contents of a folder without including the folder itself - This post ...
2
votes
2answers
54 views

What other special characters are there?

For filenames, I know that you have to use either a double quotes or a backslash to include a space in your file name. Like mkdir "I like coffee" is the same as mkdir I\ like\ coffee Now when you ...
1
vote
4answers
65 views

Bash Command Get Data from multiple files and append the file name

I have in a folder (eg /tmp) the following files 1.id 2.id 3.id 4.id so on... In these files, there is one number inside. For example in 1.id it can be the 1000, in 2.id it can be the 2000 etc. I ...
1
vote
3answers
195 views

How to add an attribute in a tag in XML file by command-line?

I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: <book name="Sed tutorial" price="250"/> Now I want to add field as Book_Width="A" after end of ...
3
votes
3answers
121 views

Print man pages with fixed width

With the example command man apropos > outputfile a text file is generated which contains the formatted man page of apropos (with some little differences with respect to man apropos directly ...
0
votes
2answers
120 views

What is the alternative for ls command in linux? [duplicate]

How can I list the current directory or any directory path contents without using ls command? Can we do it using echo command?
0
votes
1answer
13 views

Cropping a yuv444_8bit and yuv_420_10bit input using ffmpeg

I have 3 input files to crop: 1. yuv_420 10 bit 2. yuv_444 8 bit 3. yuv_444 10 bit I am unsure about which pix_fmt option to use for these. This is the command line I am using: ffmpeg -s:v 3840x2160 ...
6
votes
3answers
625 views

Insert empty line between command line prompts

When using the command line, often it gets very cluttered. Making it inconvenient to examine past commands and their outputs for example. I would like to have a newline added each time before the ...
0
votes
2answers
62 views

Display CPU cores usage in percentage without using top

I am using java to run a command on linux. Since top is an interactive command and need to press 1 to get the info of all the cpu(s) so I cannot use that. So I am using the following command to get ...
0
votes
1answer
26 views

How the command “dns-fix” works?

I had a problem on my DNS and after using this magical command, solved the problem. So I got curious: how this command, dns-fix, worked? I am using the Mint distribution. The command is standard.
19
votes
3answers
491 views

The precedence of command options?

I know that rm -f file1 will forcefully remove file1 without prompting me. I also know that rm -i file1 will first prompt me before removing file1 Now if you execute rm -if file1, this will also ...
6
votes
2answers
138 views

How to fix intermittant “No space left on device” errors durring mv when device has plenty of space?

Ubuntu 14.04 on a desktop Source Drive: /dev/sda1: 5TB ext4 single drive volume Target Volume: /dev/mapper/archive-lvarchive: raid6 (mdadm) 18TB volume with lvm partition and ext4 There are ...
-2
votes
1answer
45 views

txt file to zip file

I have a simple text file named as 'file.txt' I want to create a .zip file which only include that 'file.txt'. I tried cat file.txt | zip newZipFun.zip -@. But it compressed my parent folder. ...
0
votes
2answers
96 views

Open CSV File And Go Straight To Spreadsheet

Part of my software issues various commands to open and view different file types. For instance I use atril for PDFs and eom for PNGs. However I have a slight problem with CSV files. I can open them ...
4
votes
2answers
97 views

How to tail a log file by time?

Say my log file(log.txt) is something like 2014-01-01 22:30:30 something happened.... 2014-01-01 22:30:31 something happened.... 2014-01-01 22:30:41 something happened.... I want to tail this file ...
2
votes
1answer
41 views

Highlighting with regex within ssh session?

I'm working with a lot of routers and switches from Juniper, Brocade etc and no one of those vendors have syntax highlighting or output coloring. Does anyone knows a working solution how to setup ...