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

learn more… | top users | synonyms (1)

0
votes
1answer
11 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 ...
6
votes
1answer
814 views

How to write/edit/update the OsIndications efi variable from command line?

In the need to enter the UEFI firmware setup utility while using ultra fast boot (keyboard drivers are not loaded during POST), I wish to write to the "Os Indications" efi variable. My OS is Ubuntu ...
1
vote
2answers
160 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 ...
3
votes
1answer
208 views

prevent a command from sending both stdout & stderr to any terminal or file [duplicate]

I would like to prevent my program from sending stdout and stderr to any terminals, files or devices. For this, I have three command crossing my mind, but I cannot distinguish their differences. Could ...
0
votes
0answers
14 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 ...
26
votes
8answers
104k views

How to determine Linux kernel architecture?

uname -m gives i686 and uname -m gives i686 i386 output in Red Hat Enterprise Linux Server release 5.4 (Tikanga) machine. I need to install Oracle Database 10g Release 2 on that machine. So, how can I ...
23
votes
9answers
102k views

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output ...
2
votes
2answers
27 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
5answers
10k views

checking running process

I am new babe to Linux. So please skip to read if you are not patient with begineer. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I ls under bin ...
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
1
vote
2answers
35 views

linux terminal transfer control to new terminal [on hold]

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
23 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 ...
22
votes
10answers
3k views

Run two commands on one argument (without scripting)

How can I perform two commands on one input, without typing that input twice? For example, the stat command tells a lot about a file, but doesn't indicate its file type: stat fileName The file ...
46
votes
8answers
98k views

How do I make my pc speaker beep

Using bash, how can I make the pc speaker beep? Something like echo 'beepsound' > /dev/pcspkr would be nice.
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 ...
5
votes
4answers
2k views

Delete everything except a few extensions

Can I modify the rm command with regular expression or something to delete. every file in current directory except files with extensions *.bmp, *.wav and *.png? It should be case insensitive because ...
31
votes
2answers
27k views

How to remove a single line from history?

I'm working in Mac OSX, so I guess I'm using bash...? Sometimes I enter something that I don't want to be remembered in the history. How do I remove it?
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 ...
3
votes
3answers
47 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 ...
0
votes
1answer
50 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 ...
-1
votes
1answer
116 views

How to use the “source” command to run commands simultaneously?

For example, I have an executable called ex01 (C++ program). And I have a text file that contains a set of invocations of this program with different arguments. The text file looks like this: ...
1
vote
1answer
41 views

Is it Possible to globally set the java hs_err log Location?

I know when executing a jar using the command line option -XX:ErrorFile=[location] allows you to change where the hs_err log files are placed. I am wondering: is there is a place I can globally ...
29
votes
3answers
134k views

Zip all files in directory?

Is there a way to zip all files in a given directory with the zip command? I've heard of using *.*, but I want it to work for extensionless files, too.
27
votes
6answers
12k views

How do I split a flac with a cue?

I've got a full album flac, and a cue file for it. How can I split this into a flac per track. I'm a KDE user, so I would prefer a KDE/QT way, I would like to see command line and other gui answer's ...
0
votes
1answer
55 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 ...
3
votes
4answers
2k views

Home key not working in terminal

I am using GNOME Terminal 2.7.3 and zsh 4.3.9 (x86_64-unknown-linux-gnu) Home and End are not working. Nothing happens and nothing gets displayed when I press them. but they work when I press shift + ...
2
votes
1answer
31 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 ...
10
votes
7answers
15k views

Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)

Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like echo 'scale=25;65320/670' | bc but ...
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 ...
10
votes
5answers
15k views

Generate random numbers in specific range

After googling a bit I couldn't find a simple way to generate with a shell command a random number included in a specific range, between a minimum and a maximum. I read about /dev/random, ...
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 ...
2
votes
1answer
248 views

Is there a graphical shell or scripting environment for Linux?

I would like to draw my scripts and connect commands like blocks of functions (something similar to Yahoo Pipes). Does such an environment exist or do I have to develop it myself?
19
votes
4answers
28k views

Grabbing the first [x] characters for a string from a pipe

If I have really long output from a command (single line) but I know I only want the first [x] (let's say 8) characters of the output, what's the easiest way to get that? There aren't any delimiters.
13
votes
8answers
53k views

How to boot Linux to command-line mode instead of GUI?

I am using 32-bit Red Hat Linux in my VM. I want to boot it to command-line mode, not to GUI mode. I know that from there I can switch to GUI mode using startx command. How do I switch back to ...
2
votes
1answer
255 views

Using a string parameter in terminal

What's wrong with this command: nmcli c up uuid "$nmcli -t -f uuid c" How can I fix it? "$nmcli -t -f uuid c" is a uuid needed after nmcli c up uuid.
1
vote
3answers
69 views

pipe in shell with redirection

My understanding is that a pipe in shell like a | b redirects b's stdin to a's stdout. However, I tried ls | less < somefile, the behavior is very strange. less shows the output of ls concatenated ...
4
votes
3answers
593 views

Output exceeding terminal window height

I had run a program that resulted in many more lines of output than my current terminal window width. As a result, I could only see partial results...is there any way to get the full output? I am ...
-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 ...
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
36 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 ...
5
votes
6answers
7k views

Copy files without encryption (ssh) in local network

scp works well in all cases, but the Raspberry Pi is to weak to copy files efficiently in a secure environment (lan). The theoretically possible 6,75 MB/s via 54 Mbit wireless lan shrink down to about ...
2
votes
2answers
64 views

Why does my ls --help not work?

Marias-MacBook-Air:~ marias$ ls --help ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
2
votes
3answers
780 views

How can I restore an xkilled panel in Linux Mint without a reboot?

In Terminal, one can enter 'xkill' as a command which lets you select a window whose client you wish to kill. In fact, it can even be used to kill panels. How can I restore an xkilled panel in Linux ...
38
votes
6answers
6k views

Is there a one-liner that allows me to create a directory and move into it at the same time?

I find myself repeating a lot of: mkdir longtitleproject cd longtitleproject Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
31
votes
7answers
6k views

How do I get a websites title using command line?

I want a command line program that prints the title of a website. For e.g.: Alan:~ titlefetcher http://www.youtube.com/watch?v=Dd7dQh8u4Hc should give: Why Are Bad Words Bad? You give it the ...
5
votes
2answers
1k views

Command line to burn DVD+R DL media on Linux?

A Plextor PX-750A on a Linux system has made many DVD+R DL coasters while trying to burn an 8GB DVD .iso file with growisofs and the Schilling cdrecord program. I tried growisofs first: growisofs ...
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. ...
122
votes
17answers
58k views

How to have tail -f show colored output

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I ...
7
votes
5answers
81k views

How to create a simple .txt (text) file using terminal? [closed]

I'm just trying to review basic terminal commands. Having said that, how do I create a text file using the terminal only?
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?