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

learn more… | top users | synonyms (1)

1
vote
2answers
34 views

linux terminal transfer control to new terminal

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
20 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
49 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
45 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
121 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
52 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
29 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
35 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
49 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
46 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
16 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
90 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
67 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
55 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
52 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
64 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
175 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
116 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
96 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
12 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
619 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
25 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
489 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
118 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
44 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
72 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
91 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
40 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 ...
0
votes
0answers
22 views

Does gdm (>= 3.16.2) expose itself to the command-line?

At risk of asking an XY question, the title is only tentative. Background I'm running Fedora 22 with gdm 3.16.2, sitting underneath an Openbox session. I've recently noticed that switching to a tty ...
4
votes
2answers
189 views

grep string where next line does not contain string

I want to search all files inside a directory and its subdirectories for lines containing a certain string, but I want to exclude those results that contain a different certain string in the line ...
1
vote
3answers
71 views

Is it possible to start programs (saved in the menu) from the terminal?

Recently I switched over to Linux Mint. I am finally getting the hang of using the terminal, but there is one question that I find myself coming back to: Is it possible to start a program that is ...
2
votes
3answers
166 views

!(*.sh) works on the command line but not in a script

When I use the code below in a terminal on Ubuntu, it works fine: rm !(*.sh) -rf But if I place the same line code in a shell script (clean.sh) and run shell script from terminal, it throws error ...
1
vote
1answer
43 views

error ./c.sh: line 24: [: too many arguments in shell program

I am trying to make a shell script to print the amount of time user was logged into the system but I encountered a too many arguments error. I tried many methods from the internet but none worked. ...
1
vote
2answers
26 views

Jump to specific flag in help/man file

Let's say I'm curious about what a specific flag -T means for a command ls? Is there a way to jump straight to that using man ls...? or, and this is a slightly different question because it's not ...
-2
votes
1answer
59 views

how to delete swarm of ._ files using commandline

I have these files in MAC which have weird ._ character before filenames/folders. Which I want to delete in one shot. Is there a way to do it in commandline? eg. ._js ._css ._image if I go into ...
6
votes
4answers
589 views

How to print the name of missing files in a folder?

I have 2000+ files in a folder, but there are few files missing from the folder. Name of the files are like GLDAS_NOAH025SUBP_3H.A2003001.0000.001.2015210044609.pss.grb ...
3
votes
1answer
40 views

Turn off the backlight of an external monitor

Is there a command-line way to turn off the backlight of an external monitor connected to laptop through HDMI? This works on laptop's monitor: echo 10 | sudo tee ...
0
votes
1answer
91 views

Change hostname on SUSE Linux Enterprise Server 11 SP3 for VMware

I want to update the hostname for one of my VMware virtual machines running SUSE Linux Enterprise Server 11 SP3 for VMware . I tried changing the hostname using YaST but after reboot the old name ...
0
votes
2answers
59 views

Live monitoring of background jobs

I executed a command like this: nohup some_command &. Now this command is in the background. I can see it with the command jobs. Example output: [1]+ Running nohup some_command ...
1
vote
1answer
48 views

Get executable for any command [duplicate]

I want to know which executable gets executed for any command in bash. Example: I have firefox installed here /usr/bin/firefox, it is in the $PATH alias browser=firefox alias br=browser Now I ...
0
votes
0answers
38 views

Man-pages don't include all relevant information

Consider the man-page of this function: sysconf It doesn't have all the information that I need (e.g. all the system variables to be queried). This is an example of what I need: ...
2
votes
1answer
38 views

bash on command event (or shell)

Is there a way to capture all commands executed in a bash or even better in sh? I need a wrapper script that gets called everytime a command is executed. Like when I type cd /home/ I want my ...
1
vote
1answer
97 views

Custom GUI without desktop environment

I want to set up a custom Linux OS primarily for hobby and learning use. It doesn't need a desktop environment, but I do want to at least customize the visual appearance of the window manager and ...
0
votes
0answers
37 views

Error installing java on Virtual Machine

I am trying to deploy a server app (BaasBox) to Google app Engine BaasBox requires java 1.6 or higher to execute. when I check for java on the virtual machine using java -version, I get this: ...