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

learn more… | top users | synonyms (1)

5
votes
3answers
134 views

I am trying to find a better/easier way to count alphabetic characters in a file or shell variable

I have a file containing the following text: we are going to write something 1 2 3 wc tells me I have 1 line 9 words and 38 characters. I'm looking to count the 26 letters only (a-z, no numbers or ...
0
votes
0answers
19 views

cant edit anything on xampp as sudo user [closed]

I’m new to Linux was an avid Windows user until recently trying on an old system seeing some major differences and converting, so I apologise if this question seems simple. I’m running the latest ...
0
votes
0answers
53 views

Gmail and mutt: msmtp error

Invalid SMTP URL: ssmtp://REDACTED@gmail.com@smtp.gmail.com:465/ I can use mutt to read my Gmail, but when I try to send I get the above message. When I installed mutt a screen came up for postfix ...
0
votes
0answers
14 views

How to maximize and minimize windows from the command line? [duplicate]

Is there any way to send a command to the currently focus window to minimize or maximize? I'd like to be able to control this from a script, or tool bar launch icon.
2
votes
2answers
68 views

Difference between who and whoami commands

The man page description of who command is who - show who is logged on But there exists a similar command whoami. The man page description of whoami is whoami - print effective userid Can anyone ...
3
votes
1answer
48 views

Get a list of applications that are playing sound [closed]

I want to get a list of applications that are currently playing sound (using the sound card). I tried to search on a lot of places but did not succeed. Any method is fine (bash, Java, etc.). I want ...
0
votes
0answers
26 views

How to modify ENV in Solaris 10 [duplicate]

I wanted to edit the contents of environment when entering this "ENV" in terminal. I googled this but so far none of the solution offered works in my end. The closes solution that i got was to edit ...
1
vote
3answers
66 views

How to display contents of mounted /boot and '/' root partitions?

How to display contents of mounted /boot and '/' root partitions of Debian on SSD drive from Linux Live CD? I know ls -1 to list directory contents, but what is exact steps to get this?
4
votes
3answers
403 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
2
votes
2answers
41 views

how to recall last argument in bash with vi setting

I use set -o vi setting in bash. The shorcut Alt+. (recalling last argument of previous command) here doesn't work as in emacs mode, so what is the equivalent for vi?
1
vote
2answers
57 views

How to identify user and server with short commands?

I've been teaching my students the basics of the Unix OS (and Linux) for 4 weeks now. I want to give them a home assignment next. It's the first one so the questions and tasks won't be hard. My only ...
0
votes
0answers
37 views

How to get mpd to recognize music library?

I have arch running on my desktop and I'm trying to play music with mpd using ncmpcpp. They are both up and running, but the problem is when I open ncmpcpp it doesn't show my music. I copied the music ...
0
votes
1answer
55 views

How to determine Apache user from the command-line?

There is a question about the group, but I couldn't find any question/answer for getting the Apache user. Therefore how to determine Apache user from the command-line?
3
votes
3answers
208 views

Method for storing/remembering one liner commands

Often when configuring and adjusting unix-based systems I use a lot of one-line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you ...
1
vote
2answers
39 views

Outputting common lines from 2 files and uncommon lines from both the files in one output file

I have 2 text files. Lets name them file1.txt and file2.txt file1.txt is as follows chr10 181144 225933 chr10 181243 225933 chr10 181500 225933 chr10 226069 255828 chr10 255989 267134 ...
1
vote
2answers
61 views

Print UTF-8 file with command line tools

I want to print a file using a command like cat filename > /dev/lp0 where the file contains characters like ùàç encoded in UTF-8. Is this is possible or do I need to use CUPS? I'm using an ...
2
votes
0answers
21 views

Close All Piped Commands if one close

I'm running at least 3 commands (with progs) using pipes. For example program1 bla bla | program2 blabla | program3 bla bla Is possible to close all programX PIDS automatically if at least one ...
1
vote
2answers
69 views

How to kill all processes for a given user that take longer then X time

When I list processes with ps auxf I often see some that are stuck and I need to manually kill them. How can I do it with one command? Example ps result: $ ps auxf USER PID %CPU %MEM VSZ ...
1
vote
1answer
44 views

Is autocompletion for applications done by shell?

When I type evince, and then hit tab, the bash shell will list all files that can be opened by evince, which seems to be based on the ext part of the filename. Is this done by shell or the ...
2
votes
2answers
58 views

Use awk to find first occurrence

I have a log file that gets updated when my script runs. The script will insert "Start of script" text when it starts and "End of script" text when it finishes running. I am trying to capture the ...
5
votes
7answers
713 views

Linux command line. Move all files and directories in directory, except some files and directories

I have a folder A which has files and directories, I want to move all those files and directories to another folder B, except file, file2, directory, and directory2. How can this be done?
0
votes
0answers
29 views

What does !$ mean exactly? [duplicate]

echo !$ outputs different strings depending on my previous command line call. For example: mrdumbdumb-redhat:~ mrdumbdumb$ ls mrdumbdumb-redhat:~ mrdumbdumb$ echo !$ echo ls ls ...
2
votes
4answers
153 views

How to display the number of lines, words and characters in separate lines?

I want to display the number of lines, words and characters, in a file, in separate lines? I don't know anymore than using wc filename for this.
3
votes
2answers
105 views

get result text from CLI command

I'm writing a bash script and I need to capture the text resulting from the output of the rsync command, for instance, the following command: rsync -av "$FOLDER1" "$FOLDER2" prints: ... sent ...
2
votes
2answers
42 views

How to make an infinitely executing command kill itself when certain conditions are met?

I'm running a command on command line which infinitely generates a certain data and I'm looking for a particular bit of data, so I used grep to find it. As soon as I get the data, I want the command ...
1
vote
1answer
81 views

How do I Nohup an interactive shell-script?

My Script is having 2 command-line arguments and then just couple of questions, after these questions the script will run for itself, I'm able to pass the command-line argument by just doing, ...
1
vote
3answers
186 views

Execute a file if a command is not found

When I try to execute files in Linux, I'm always annoyed by the need to write ./executablefile instead of just executablefile. I get why it's done, so it won't have an ambigous input, one that is a ...
0
votes
1answer
27 views

Command line utility to learn bit twiddling hacks

I am currently reading Hacker's Delight and would like to practice as I read through the book. Is there any command line *nix tool to perform binary operations and see output in binary?
1
vote
3answers
71 views

What is the concept hidden behind the term “command”?

I have been using, studying and developing for Linux for quite a few years now, and over time, I have successfully convinced a few people to join the cause, and make the switch to Linux. However, ...
1
vote
0answers
50 views

How to connect tata photon in X window manager in ubuntu 14.04 using command line

Due to some reason I had to shift from Gnome to X(basic X). So here on the desktop nothing appears (no launcher, no menu bar, nothing) but we can open command line in it using Ctrl+Alt+Tab. (I have ...
1
vote
1answer
62 views

Apply recursive chmod to files or folders only

I'd like to apply chmods to files and folders in one line, Basically: chmod 700 ./* -R # but only apply to folders chmod 600 ./* -R # but only apply to files Of course I searched google and read ...
2
votes
1answer
73 views

How to sort files based on the json property value inside the file?

I've downloaded list of videos via youtube-dl and each file has corresponding .json file containing certain properties. So I would like to sort the files based on the selected json property which is ...
4
votes
3answers
494 views

How to disable beep sound in Linux CentOS 7 command line? [duplicate]

I just installed the basic Linux CentOS 7 (no desktop) and am experimenting with the system. Every time I make a mistake (entering things that the command line doesn't like), the computer beeps and ...
0
votes
0answers
5 views

Is there a way to scan all configured maven repos for a a package?

Lets say I am writing code and I decided I want a certain package, but I don't know rather the repos I have setup have that package, or which version of the package they may have. Is there a quick ...
1
vote
1answer
39 views

how to detect video completion in vlc

Vlc provide documents in which there are lots of command are given to control vlc from command line. Here is the link of documentation. Now in my task, I need to run a video in a loop, for this I am ...
1
vote
4answers
390 views

Why do we use double hyphen in “tar --anchored” and single hyphen in “tar -b”? [duplicate]

Why do we use double hyphen in tar --anchored and single hyphen in tar -b? I mean to say why some command line options have single hyphen (-) while some others have double (--)? Also a git example: ...
1
vote
3answers
117 views

How to do command-line completion with files and folders

As a new Linux user, one of the things that's kept me away from the Command Line (CL) is that, for tasks involving files and folders (i.e. everything!), the amount of typing involved makes using the ...
3
votes
1answer
451 views

Set Ubuntu System Proxy Settings without Restart from commandline

I am using Ubuntu 14.04 . I want to change the http proxy settings from the command line. This should be equivalent to changing in the GUI(All Settings->Network->Network Proxy) and clicking the button ...
5
votes
1answer
120 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 ...
3
votes
2answers
199 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 ...
6
votes
1answer
240 views

Echo difference between Ubuntu and Red Hat

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying environment variables. In Ubuntu I ...
2
votes
1answer
133 views

Login to Skype from terminal or any other way

Please let me know if anybody knows how to login to Skype on Linux Mint from terminal or any other way? I have tried a lot but nothing found. Desktop # ./skype.desktop ./skype.desktop: line 1: ...
0
votes
0answers
24 views

characters stick at the CLI [duplicate]

When I press arrow up to search through the command history, some characters always remain at the beginning of the command line. Does anyone know what's going on ? How can I fix it? for example, I ...
7
votes
2answers
250 views

Is there a shortcut for repeat the second proximate command in bash?

We all know that !! can repeat the last command you do in bash. But sometimes we need to do some operation like $ python test.py $ vim test.py $ python test.py # here is where I need to repeat the ...
18
votes
2answers
1k views

Coloring different sources for tail

I'm watching different logs by tail -q -f /var/log/syslog -f /var/log/fail2ban.log -f /var/log/nginx/error.log How can I have the output of each log colored differently?
1
vote
1answer
51 views

Listing audio files with bit rate in the command line

Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried ls -l but it doesn't work.
1
vote
1answer
97 views

Command-line parameters in bash script not recognised

I use Debian (Raspbian) Wheezy. If this command line works fine: smsd -c sms/out -i 60 -0 -f sms/smsd.log and this alias also works fine: bsmsd='smsd -c sms/out -i 60 -0 -f sms/smsd.log' then ...
4
votes
3answers
57 views

Is it possible to view the list of file names of a zip file which is inside another zip file?

I know I can use unzip -l file.zip to view the file list of a zip file. But a got a zip file inside another zip file. I tried unzip -l file.zip/sub_file.zip, but failed. Is it possible to view the ...
2
votes
2answers
233 views

How parse a log file for a string, and when found search backwards for another string

I use the following command to parse a log file for a particular string. Then I search backwards in the log to find the data I really want. The problem as in the example below, I am only going back ...
5
votes
1answer
252 views

How to rollback network configuration changes done over SSH in case of failure?

I'm about to change iptables configuration and interface speed and duplex settings over SSH. What are the possibilities to rollback the changes in case of host becomes unreachable? I guess simple: ip ...