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

learn more… | top users | synonyms (1)

6
votes
3answers
636 views

Is w command safe for users?

Some applications allow to pass password as an argument. For example: mysql --user=user_name --password=your_password db_name Is it safe? Besides the fact that typed password would be saved in bash ...
2
votes
0answers
57 views

Open a program (VLC) and move it to the foreground

On a Mac, specifically, when I use the VLC command line to open a video file, it opens in the background by default. How can I instead move it to the foreground whenever I run the command to open a ...
2
votes
4answers
145 views

How can I disable lightdm auto-login from the command-line when isn't possible to get a GUI session?

Suppose auto-login to a session is active in Ubuntu. So there will not be an opportunity to select a session (e.g gnome, unity, kde, etc). But if the environment is corrupted there is no way to escape ...
1
vote
1answer
22 views

A quit command weaker than windowkill?

Typing in xdotool getwindowfocus windowkill currently terminates the active window and bypasses any safeguards like "would you like to save your work?". Is there a weaker command than windowkill I ...
1
vote
0answers
21 views

Control iPhone music from linux command line

Is this possible? Could one, for example, send a command to an iPhone which tells it to start playing a certain song?
0
votes
1answer
33 views

Installing Xcape (a newbie question involving the “make” command)

I executed the minimal building directions of xcape: $ sudo apt-get install git gcc make pkg-config libx11-dev libxtst-dev libxi-dev $ mkdir xcape $ cd xcape $ git clone ...
1
vote
2answers
34 views

Listing folder contents during cd command

I might be mistaken here, but I was watching someone navigate using the cd command, and without actually executing it, they were able to show the folder contents of the current folder. So if I type ...
5
votes
1answer
248 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 ...
2
votes
1answer
24 views

Gnu screen: remap “c-a c-a” to send “c-a”

I use GNU Screen on occasion, and my Emacs keybinding muscle memory is hard to overcome. I know that I can send a control-a (i.e. "go to beginning of line") by hitting "c-a a", but I'm wondering if ...
6
votes
2answers
373 views

What is the reliable way of getting each user's .ssh directory from bash?

I can parse the /etc/passwd with augtool: myuser=bob usershome=`augtool -L -A --transform "Passwd incl /etc/passwd" print "/files/etc/passwd/$myuser/home" | sed -En 's/\/.* = (.*)/\1/p'` ...but it ...
1
vote
0answers
36 views

How do I recursively apply default ACLs of a directory to its descendants?

If I have a directory with default ACL entries assigned to it, but some or all of its descendant files and sub-directories have access or default ACLs that do not agree with those defaults, how do I ...
11
votes
3answers
18k views

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux). I run: sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits' Then I try to obtain an ...
0
votes
0answers
23 views

Help with a bash script [duplicate]

I'm trying to get a script working that will examine two directories and list all of the duplicate files found in both. Looking for duplicates based on content. And then have the script report the ...
3
votes
3answers
417 views

Why when I ssh into one server it shows bash and the other have my username?

So at work I have two web servers that I am able to ssh into. Both are RHEL 6.5 When I log into one, it shows this: [username@ldvweb01 /]$ When I log into the other one it shows: -bash-4.1$ ...
0
votes
1answer
55 views

how to find out the name of the server on which the files are hosted on? [closed]

I've tried numerous thing such as uname -a, env, findsmb, amongst other things but that will only give the hostname which is not the server where the files are hosted... I get that there is nfs ...
3
votes
2answers
11k views

Command to install linux headers fails

I need to install my linux headers for an Nvidia driver install. But I get an error when doing so: peter@peter-deb:~$ sudo apt-get install linux-headers-$(uname -r) Reading package lists... Done ...
16
votes
7answers
1k views

How to efficiently generate large, uniformly distributed, random integers in bash?

I have been wondering what would be the best way to get good randomness in bash, i.e., what would be a procedure to get a random positive integer between MIN and MAX such that The range can be ...
3
votes
3answers
216 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 ...
19
votes
11answers
8k views

Is there a robust command line tool for processing csv files?

I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line. In many cases cut, head, tail, and friends will do the job; however, cut cannot easily ...
9
votes
4answers
1k views

Windows shell Escape key (delete whole line) equivalent in Bash

In Windows command line (powershell and cmd), when you press Esc key while on a line, whatever you have typed at the prompt is removed. I found that pressing Esc key at bash prompt does nothing. ...
-1
votes
2answers
5k views

How to delete a file in Arch console?

pacman stopped working and asked me to delete a file if "another package manager isn't working". What is the file for deleting files?
0
votes
2answers
3k views

How to add an IP to hostname file

I have a Centos 5.8 server. How can I add my server IP address 192.168.20.254 so that it reflects when I run the command hostname -i At the moment the command only shows the loopback IP 127.0.0.1 and ...
3
votes
4answers
2k views

get age of given file

How can I get the age of a given file in, at least, days? I'm well aware of ls -lh and similar commands. I want something that will work sort of like this: getfage <FILE> # prints out '12d' ...
2
votes
1answer
61 views

How to gather byte occurance statistics in binary file?

I'd like to know the equivalent of cat inputfile | sed 's/\(.\)/\1\n/g' | sort | uniq -c presented in ...
2
votes
2answers
72 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?
0
votes
2answers
61 views

Add space after 8 characters then add space after every 4 characters

Here is the sample input: AbbigailAbieAbbyAbbi Using sed, I have separated them into 4 characters but seems like I got a problem because I have to separate the first 8 characters first then add ...
0
votes
0answers
27 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 ...
8
votes
4answers
564 views

How do I remove spaces from shell variables?

I have done the following at command line: $ text="name with space" $ echo $text name with space I am trying to use tr -d ' ' to remove the spaces and have a result of: namewithspace I've tried ...
5
votes
3answers
168 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 ...
1
vote
2answers
148 views

Count how many lines start with which characters

I have a file with a number of lines in a file filename. I want to count how many lines start with character 'a', with 'b' and so on in one go. What command i should execute.?
34
votes
8answers
6k views

Easy way to determine virtualization technology

I have command line access to a Linux machine which may or may not be virtualized. I want to determine what kind of virtualization technology it runs on, if any (VMWare, VirtualBox, KVM, OpenVZ, Xen, ...
0
votes
0answers
89 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
287 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
52 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 ...
8
votes
3answers
5k views

How do I grep without leading whitespaces?

I'm greping through a large codebase, and leading whitespaces and tabulation seem to be quite annoying. Is there any way to get rid of it? grep -R "something" ./ E.g, instead of: foo/bar.cpp: ...
1
vote
3answers
107 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?
7
votes
5answers
18k 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
2
votes
2answers
635 views

How to change a firefox option on a quick way (via shortcuts, command line,..)?

In Firefox we have two options at Firefox->Preferences->Preferences->Fonts and colors->Colors menu, Use system colors and Sites can use other colors. I would like keep the first one ...
8
votes
3answers
1k views

How do I take a list and remove it from a file?

I have a long list of domain names that I need to remove from /etc/remotedomains. They're probably not in any particular order in the file. Each domain is on one line. How could I iterate through the ...
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 ...
4
votes
3answers
439 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 ...
7
votes
1answer
369 views

Echo difference between Ubuntu and Red Hat [closed]

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 ...
1
vote
2answers
61 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
55 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
119 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?
1
vote
2answers
50 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 ...
5
votes
7answers
1k views

What is the easiest way to add a string on the beginning of every line of the file from the command line?

I am looking for a way to add some string to the beginning of every line (same string for every line). Not something customizable but rather something that will be easy to remember and available on ...
6
votes
3answers
2k views

Easy way to paste command line output to paste bin services?

Are there any command line tools on Linux that allow you to post output from commands or text files directly to a sharing service such as pastebin.com?
3
votes
9answers
3k views

How to generate a year-quarter date from the command line?

I'm interested in outputting a representation of the current year-quarter, as well as the year-quarter for the previous month. If today is 2012 January 1st, I'd like to get 2012q1 and 2011q4 as ...