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

learn more… | top users | synonyms (1)

15
votes
3answers
1k views

Manipulating X key and pointer grabs on the command line

What command line tools exist to list and manage X server grabs? (That's grab as in key and pointer grabs, i.e. restricting the use of a particular key or mouse button to a particular application, or ...
2
votes
1answer
46 views

What command(s) can I use in a terminal to find a program that does a particular thing? [duplicate]

I often find myself alt-tabbing to google "How to do X in Linux". Is there a way to search (say, man pages) in Linux to find tools that might be of use in a particular situation? For example, ...
0
votes
3answers
25 views

Separating command arguments from flags

Say I have a command that takes flags and arguments, like this: mycommand --foo bar arg1 arg2 (The foo flag has a value of "bar".) But what if the foo flag can optionally be supplied with no ...
1
vote
2answers
64 views

How do I change FROM address using mailx on FreeBSD from command line?

I'm using following system: $ uname -a FreeBSD X 9.2-RELEASE-p17 FreeBSD 9.2-RELEASE-p17 #0 r282430: Mon May 4 13:59:58 PDT 2015 root@X:/usr/obj/usr/src/sys/R610 amd64 $ pkg info mailx mailx-0....
1
vote
0answers
10 views

Setting locale in a systemd-nspawn container (debian jessie)

Trying to get powerline/airline symbols to show in vim running in a Debian container created with sudo systemd-nspawn -D ~/debian-tree/ on a Fedora host. Right now it just shows question marks in ...
0
votes
1answer
534 views

Editing a child JSON element value with jq

I'm trying to use jq in order to change a child's value. For instance, I want to change the value of "test2" from ["yo", "bye"] to ["hi"]. { "title": "hello", "body": { "test1": 123, ...
1
vote
1answer
52 views

Capture all output, error, warning and their appearance order of linux's command

In linux we can redirect stdout and stderr or both of them to files. For example: Redirect stdout and stderr to two files: command 1>out 2>err. By this way, we can separate output and error in ...
35
votes
10answers
147k 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 ...
1
vote
1answer
48 views

basic webscraping from the CLI

I'm trying to fetch html tags and their attributes from a webpage with linux command line tools. Here's the concrete case: Here's the task: Get all 'src' attributes of all 'script' tags of the ...
0
votes
1answer
27 views

Ping through a specific Ethernet port

I am using RHEL 6.4, I have teamed two Ethernet ports (eth2 and eth3). I am trying to test the connectivity, I mean I want to test whether the eth2 and eth3 are working or not? One way is to disable ...
0
votes
1answer
31 views

What does | symbol near end of a command do? [duplicate]

I came across someone using the command zcat [filename].gz | less to open a file. What does | generally do when it's using in this manner? I've tried googling the question but haven't found the answer ...
70
votes
10answers
48k views

How can I move files and view the progress (e.g. with a progress bar)?

When moving large directories using mv, is there a way to view the progress (%)? The cp command on gentoo had a -g switch that showed the progress.
2
votes
2answers
2k views

How to get sound intensity of an audio input through terminal?

I want to know the intensity of the sound being heard by an audio in source like a mic or Line-in through Command line. Kinda like the progressbar under the mouse but in CLI. audiointensity mic0 10 ...
8
votes
1answer
2k 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 14....
2
votes
2answers
136 views

Find IP owners from apache log file

I have the top 10 IPs making the most requests and the number of requests made from Apache log file example. I used this bash command to handle a request: cat access_log|cut -d' ' -f1|uniq -c|sort -r|...
2
votes
2answers
2k views

How can I check the Base64 value for an integer?

I would like to check the Base64 value for an integer. There is a base64 linux command but I don't understand how I can apply it on integers. I have tried with base64 10 but then I get the error ...
6
votes
1answer
110 views

How do I get vendor-given name of my video card?

lspci gives me the following information: $ lspci|grep VGA 01:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1) This is all correct, but this is generic name of ...
1
vote
4answers
68 views

How do I delete file by filename that are set as dates?

I want to delete file not by date access or created, but by filename. The filenames will be dates and I want to have a cronjob run once a week that will purge filename dates older than 7 days. I could ...
1
vote
3answers
3k views

Bring up shutdown menu of Cinnamon via command line

How can I bring up the shutdown menu of Cinnamon via command line? Note: I don't want the user menu. This menu for switching or logging out a user is brought up via Ctrl+Alt+Del.
19
votes
3answers
40k views

How do I remove all sub-directories from within a directory?

This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-...
2
votes
1answer
43 views

Pausing terminal output

I have a command which outputs lots of data (say, strace with lots of syscalls, running for a few minutes). Is there any option (e.g. command wrapper or something similar) that would allow me to ...
4
votes
3answers
230 views

Difference in cat sth vs cat < sth [duplicate]

I am new in linux.I have been playing with bash commands and realized that cat sth and cat < sth both happen to give same output. Are they same? Can someone explain?
0
votes
1answer
29 views

Pemission denied when trying to create a directory [closed]

[SHARAD@localhost ~]$ cd /var/www/html [SHARAD@localhost html]$ mkdir sharad mkdir: cannot create directory ‘sharad’: Permission denied [SHARAD@localhost html]$
3
votes
6answers
197 views

Find a pattern and insert # at the beginning of 2 line before 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 ...
67
votes
3answers
56k views

What are the differences between most, more and less?

I'm now using Arch Linux, and find a command most works like more and less. To understand the differences between them is a confusing problem. This Question has mentioned the differences between less ...
3
votes
2answers
798 views

Jingle CLI client / Jitsi replacement / VOIP

I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this program....
-1
votes
1answer
50 views

How to create a bootable partition with an ntfs file system that is compatible with a Windows 8.1 boot USB drive

I've been trying to use fdisk and gparted and I believe that I have a suitable partition on /dev/sdb1. Here is my command list: fdisk /dev/sdb1 n (I filled the whole drive with a new ...
1
vote
0answers
17 views

Rejoin words breaked by hyphen and double newline characters

I have converted some PDF files to text by Calibre. Sample text as below: The booming population, coupled with a development strategy pre- mised on high levels of investment, meant that an ...
4
votes
4answers
421 views

How to obtain grep exit status into a variable

I started learning Bash a couple of days ago. I'm trying to obtain an exit status of grep expression into a variable like this: check=grep -ci 'text' file.sh and the output that I got is No ...
1
vote
2answers
40 views

Use root privilege without password

I am on Debian 8 and I am searching for a command in debian to use root privilege without password. I am asking because I already saw it somewhere but can't find it anymore.
1
vote
1answer
34 views

backgrounded job keeps stopping

I am seeing some strange behavior on my RHEL6 bash prompt. I often like to execute command lines that look like ... $ ./myscript > junk 2>&1 ... then hit ^Z and then execute ... $ bg $ ...
1
vote
1answer
37 views

Appending a line to a [section] of a config file

I've noticed that some Linux configuration files (e.g. /etc/samba/smb.conf) expect you to enter the actual settings (key value pairs) in a particular "section" of the file such as [global]. I'm ...
-1
votes
2answers
65 views

ps command not working properly? [closed]

I am using a Debian Virtual Box with the Bash shell and I am trying to use the ps command with the -c switch to find an ID of a process by searching its name. This is what I write: ps -c processname ...
3
votes
1answer
209 views

How do I access a folder which I can't sudo cd into?

I'm trying to change my directory to /boot/efi, but running sudo cd /boot/efi does nothing. I'm on fedora 23. Is there a more powerful command for this?
1
vote
3answers
64 views

awk to consolidate large tabular file?

I have a file with 21 tabular fields in columns. Tabs 14 and 15 are sets of data which are repeated several times for variables in tab 10(up to ":") and tab 11 has numeric descriptive data for tab 10 ....
28
votes
6answers
98k views

count lines in a file

I'm sure there are many ways to do this: how can I count the number of lines in a text file? $ <cmd> file.txt 1020 lines
0
votes
1answer
62 views

How could I know my server's operating system? [duplicate]

I’m connected to my shared hosting server via ssh, and all I know is that it’s under Linux. I tried commands like: cat /etc/issue/ and lsb_release -a but got: $ cat /etc/issue/ No such file or ...
2
votes
2answers
217 views

How can I change the IP and gateway addresses permanently?

I recently installed Linux Ubuntu 14.04 to my computer. To enable internet connection I needed to change my IP and Gateway address. I did the following as a root user # ifconfig eth0 "my ip address ...
0
votes
1answer
31 views

change IP address

I tried to change my private IP address with the following commands: sudo ifconfig wlp3s0 down sudo ifconfig wlp3s0 192.168.1.12 sudo ifconfig wlp3s0 up They just work fine becouse the IP changes ...
3
votes
0answers
60 views

two piped commands, each needs to read password from stdin

Is there a way to sensibly do this: scp user@host:/path/to/file /dev/tty | openssl [options] | less without creating a file, and without having to supply either password directly in arguments? The ...
-1
votes
1answer
50 views

Tried to install Nvidia drivers, now I can only boot to tty [duplicate]

I'm on Fedora 23. I followed this guide and got all the way up to the "2.7 Reboot to runlevel 3" step. I did that step then rebooted and now I can only boot into tty. I tried to continue on with ...
14
votes
12answers
8k views

Console Text Editor with Windows-like keyboard shortcuts (ctrl-z, x, c, v)

Ok, I realise that I risk a religious war asking a question about text editors, but here goes. Requirements Mostly used for config file edits Text based not GUI Available for Raspian flavour of ...
5
votes
2answers
265 views

no null in /dev error

I executed the following line: which lsb_release 2&>1 /dev/null Output: error: no null in /dev When I verified the error using the ls /dev/null command, null was present in /dev. Why is ...
68
votes
6answers
63k views

Is there a tool to get the lines in one file that are not in another?

Is there any tool that can get lines which file A contains, but file B doesn't? I could make a little simple script with, e.g, perl, but if something like that already exists, I'll save my time from ...
-3
votes
1answer
49 views

What command lines should I use for the following? [closed]

What command lines should I use for... printing a list of users running bash now in alphabetical order print the count of users who are running bash right now save the list of users who are running ...
3
votes
4answers
114 views

All possible permutations of words in different files in pairs

I have multiple files, let's say file1, file2 etc. Each file has one word in each line, like: file1 file2 file3 one four six two five three What I want is to combine them in a new file4 in ...
1
vote
0answers
11 views

Fluxbox, how to launch specific instance of application in a workspace (from cli)

This almost does what I want Fluxbox, how to launch some applications in a specific workspace at startup but not quite. I want to be able to save the position and workspace of a specific instance of ...
1
vote
2answers
24 views

How to inhibit dhcpd from outputting over the console login prompt?

As dhcpd negotiates it prints its output on the login prompt, which clutters (messes up, wrangles, uglifies, writes over, obscures [synonyms for googlers]) the console login prompt. How to inhibit ...
61
votes
13answers
148k views

What is the fastest way to view images from the terminal?

The terminal is very fast and convenient way to quickly access directories and files (faster than find and click on the directory). One thing that it cannot show in text-mode is "pictures". What ...
26
votes
9answers
2k views

How to tell what type of filesystem you're on?

Is there a command to tell what type of filesystem you're using?