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

learn more… | top users | synonyms (1)

3
votes
1answer
95 views

Set default shell as bash for users not in /etc/passwd

On my company's Ubuntu 15.10 desktop system, I log in via Active Directory using some magic based upon PBIS. Thus, my user account is not listed in /etc/passwd even though I have a home directory ...
0
votes
1answer
32 views

Debian: “update-command-not-found” IOError: Not a gzipped file

I run a random command in terminal and got this response: Could not find the database of available applications, run update-command-not-found as root to fix this Naturally, I run ...
4
votes
2answers
68 views

How to modify files on Unix to avoid file purging policy?

We have a policy on our cluster that any files not modified or accessed within 30 days will be deleted. I have a project running and I want to keep all files until I finish it, would it be possible to ...
1
vote
2answers
105 views

`open` command to open a file in an application

Why can't I run this command in my terminal: open index.html Wasn't it supposed open this file on my browser? Also can't I run this command: open index.html -a "Sublime Text". The result of these ...
5
votes
3answers
33k views

Fix “firefox is already running” issue in Linux

I am trying to open Firefox in CentOS, but I'm getting the following message: Firefox is already running but is not responding and Firefox doesn't open. I tried this in command line: kill ...
4
votes
5answers
3k views

Pipe the output of a command to rm command

Following command prints the path of the song being played. mpc | head -n 1 songs/oldSongs/Mukesh_D/041 KANHAIYA = YAAD AAYI ADHI RAAT KO.mp3 Can I delete this file by modifying the command I used ...
0
votes
1answer
50 views

How to create a dynamic greeting?

Recently made the switch to Linux/command line, and I'm having trouble creating a dynamic greeting for terminal out of a list of predetermined possibilities. I tried the following, but it appears as ...
10
votes
4answers
822 views

Why doesn't echo called as /bin/sh -c echo foo output anything?

For example, while this works: $ echo foo foo This doesn't: $ /bin/sh -c echo foo Whereas this does: $ /bin/sh -c 'echo foo; echo bar' foo bar Is there an explanation?
0
votes
3answers
83 views

How to display size “human-readable” in lsof | grep /var* [duplicate]

I am currently trying to see , all the files which are using /var mount. With lsof | grep /var* when Its displaying size in bytes. How can I display file size in MB. Thank you.
5
votes
3answers
562 views

Any tips for surviving Terminal.app?

I've recently switched to using a Mac full-time, and am having trouble getting used to Terminal.app after years of loving gnome-terminal. I miss having URLs show up underlined, using alt+arrow to ...
1
vote
1answer
33 views

Difference between “-” and “--” prefixed command line parameters? [duplicate]

Scripts on command line offer a wide range of parameters types. Often parameters can be passed to the script via "--[parameter]" or "-[parameter]". But what is the difference? Why do some parameters ...
0
votes
1answer
26 views

Pattern highlighting command [duplicate]

Folks, I want to know if there exists a command that just highlight some portions of the input text, rather than filtering it like grep does. To give an example, suppose the following input text: ...
9
votes
4answers
4k views

How to constraint time a program runs in Linux?

I have several simulations to do, each is invoked with python simulate.py <parameter list>. The problem with these simulations is that some of them hang without quiting, which prevents me from ...
0
votes
1answer
23 views

control-w (delete word) deletes whole line in MariaDB client

I've been using the original MySQL client for "eons" and I'm rather accustomed to using bash-like shortcuts in it. One of my more frequently used ones is to use control-w to delete the word before the ...
48
votes
7answers
9k 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.
0
votes
1answer
19 views

Find out user logged in at specific time on Mac OS X 10.11.x

I'll like to find out which user was logged in at a particular time that a file was created. I'm having trouble with the "Last" command when attempting to use the "-t" switch. Open to any ...
1
vote
1answer
16 views

command to enhance console lines with history

cmd utils such as sqllite don't have full flavoured console support. but I do remember there is something called **wrap which could wrap this console and enhance its capabilities with history, up/down ...
0
votes
0answers
12 views

Monitor shuts down when entering Terminal [Linux Mint]

I have a relatively small monitor for one of my machines that Linux Mint. When entering the terminal (ctrl + alt + F1) The monitor shuts down and I have to, completely blind, scrawl out my login and ...
3
votes
2answers
3k views

Print text from terminal

I would like to use a Linux distro without a desktop environment, but I need to print out homework that I type up. I could always email it to myself and print from another computer, but it would be ...
5
votes
4answers
660 views

Does bash have a built in caching command available (sort of like mktemp or sponge)?

I'm using the amazon ec2 command line tools, and the ec2-describe-instances tool is a little painful because of the 2-5 seconds it requires to make the request and display the output. I'm looking ...
65
votes
10answers
49k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
1
vote
1answer
46 views

How do I change a LUKS password?

I would like to change a LUKS password. I want to remove my old password, but I would like to try out my new password before removing the original. I obviously know the old password. I would like to ...
3
votes
1answer
94 views

ss - linux socket statistics utility output format

When using ss with -p option, user/pid/fd column jumps underneath the particular line. For instance this is it what I'm actually seeing: # ss -nulp4 State Recv-Q Send-Q ...
1
vote
2answers
140 views

File manipulation; Insert a “;” every 12th, 44th and 60th character in every line of a text file

I have to make a csv-file from a textfile which contains data without any delimiters. Looks like: 2015021DUMMY001EAN1377689456777678945GERDE0002345 2015031DUMMY002EAN1345647876867867867TURTR0154565 ...
1
vote
3answers
140 views

Number of occurrences in a text file where first character after 12th pipe is equal to 1?

I am fairly new to regular expressions and am looking for a sed/awk/grep/wc command to find the following in a pipe delimited text file the number of occurrences of the digit 1 after the 12th pipe. ...
5
votes
8answers
401 views

Generate two sequences of numbers separated by “|”

I'm using bash (CentOS 5) and looking to generate this output (I assume I could use seq or echo together maybe?): 1|1, 2|2, 3|3, .... 31|31, 32|32, 33|33, I googled seq examples for over two hours ...
5
votes
2answers
182 views

Command to remove the first N number of lines in input

Background I am running an SSH server and have this user that I want to delete. I cannot delete this user because he is currently running a few processes that I need to kill first. This is the ...
15
votes
2answers
44k views

Connect to a Bluetooth device via Terminal

I'm using Mint 15 w/ cinammon. I bought a set of bluetooth speakers and i'm tring to connect to them via terminal. Via GUI i can see them normally and i am connected to them. I want to make a small ...
2
votes
0answers
103 views

GLIBC not loading even after source compilation

While I am installing chef , I am getting below error. [root@centos Tools]# chef-server-ctl reconfigure /opt/opscode/embedded/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ...
0
votes
0answers
22 views

How does GUI works different from the shell CLI?

For example if I want to remove a file I would write rm command in my shell CLI. But when I delete a file using GUI how does the process works ? For shell it would find the filesystem for rm program ...
3
votes
2answers
331 views

The type command can't distinguish between an executable command and a shell script

So I was reading the book The Linux Command Line, and it says that commands are of four types: (1) executable programs (2) shell builtins (3) shell functions (shell scripts) (4) ...
1
vote
0answers
19 views

Search drive and copy source to flat target

I have backups and backups of backups (there are copies of copies) of images spread out over various drives. I want to scan the drives and copy all images from a source to one flat target directory. I ...
0
votes
3answers
32 views

Is there a way to know which files are being created, read or updated by running app? [duplicate]

I would like to list all files that have been read, created or updated from the app running.
3
votes
3answers
651 views

Change (not remove) “fortunes” in Linux Mint console

I don't mind the idea of quotes when I load the Mint console, however the OEM text leaves much to be desired. I'd like to update the quote text with inspirational or otherwise useful quotes. How ...
1
vote
1answer
77 views

Want to print NULL if value is not present as awk output

I am trying to print a tshark command output using awk below is my command: tshark -r "test.pcap" -odiameter.tcp.ports:"1234" -R 'diameter.cmd.code == 272 and diameter.flags.request==0 and ...
2
votes
1answer
68 views

Scroll by line in terminal rather than by page Shift + PgUp

Is there a keyboard way to scroll the terminal by line the same way we scroll with mouse wheel? Shift+PgUp/PgDown give only by-page scrolling. I would like to scroll slowly as with mouse wheel. My ...
0
votes
1answer
25 views

Whatis command (shell builtin vs executable programs)

I know that whatis command is used to output a brief description about an executable program (Command). So both whatis cd whatis type Will print: nothing appropriate (Because from my ...
0
votes
1answer
29 views

pv (progress bar) and gzip

Why is this not possible? pv ${dest_file} | gzip -1 pv is a progress bar error gzip: compressed data not written to a terminal. Use -f to force compression. For help, type: gzip -h 0 B 0:00:00 ...
4
votes
3answers
2k views

Obtain .avi file info from command line

What is the best way to obtain information as bitrate, framerate, width/height of an movie file (in my case .avi) from the command line? I am looking for a basic tool that works similarly as ...
18
votes
1answer
60k views

How do I get sar to show for the previous day?

on our servers, typing sar show's the system load statistics for today starting at midnight, is it possible to show yesterdays statistics?
15
votes
12answers
7k 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 ...
62
votes
9answers
40k 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.
0
votes
1answer
48 views

Can I make alias for alias in bash?

In some circumstances, I need to make an official alias for a set of command, which acts just the same as the original software. Like: alias ipython3="source /Users/zen1/miniconda2/bin/activate py3k; ...
40
votes
6answers
22k views

Split pages in pdf

I have a scanned pdf file which has scanned two pages on one virtual page (page in pdf file). The resolution is with good quality. The problem is I have to zoom when reading and drag from left to the ...
-3
votes
2answers
49 views

C Programming on command line [closed]

What to do after opening vim name.c and writing the source code? I mean, to compile and execute.
21
votes
6answers
39k views

Linux ls to show only filename date and size

How can I use ls in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?
0
votes
0answers
27 views

Usage of the <<< operator [duplicate]

I recently ran across an example usage of the bc to output an expression like this: $ bc <<< "1+1" Which is the equivalent of: $ echo "1+1" | bc Does the <<< operator just ...
3
votes
1answer
128 views

How can I write data separately in many text files which contain the same fields?

I have a text file which contains around 9999999 lines. Here I'm pasting the few lines: 1874641047 Gazipur 1874646347 Jessore 1845105653 Chittagong 1845146123 Narayanganj 1845164162 Gazipur ...
2
votes
5answers
624 views

How much disk space does a list of files use

How can I find how much disk does a list of files uses? I'm looking for a variation of du -s *.sql I want to see only the grand total, and with the command above, it always shows a line for each ...
98
votes
6answers
134k views

How do I get the size of a directory on the command line?

I tried to obtain the size of a folder (containing folders and sub folders) by using the ls command with option l. It seems to work for files (ls -l file name), but if I try to get the size of a ...