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

learn more… | top users | synonyms (1)

1
vote
3answers
98 views

How to enter foo-* folder without actually using wildcard or shell expansions?

Short story I'm looking for the command to enter first found foo-something directory like: cd foo-* but without using wildcard (or other special shell characters). Long story As part of the ...
1
vote
1answer
46 views

Redirect output to stdout and pipe to a binary

I have a nice PS1 line in my .bash_profile, and I want to copy it to another machine. So I want to view it AND copy it to my clipboard. I can't figure out how to string the commands to do this ...
0
votes
1answer
100 views

How do I use vim on the command line to add text to the middle of a file?

I am trying to write a command along the lines of the following: vim -c "XXXXXX" myFile Instead of the "XXXXX" I want to supply some commands to vim to add some text to an arbitrary point in the ...
0
votes
0answers
60 views

What is the command-line equivalent to 'mintupdate' for Linux Mint?

Linux Mint has a nice GUI-based Update Manager with selectable update tiers. The defaults are for levels 1 through 3 our of a possible 5 levels. However, I often handle administrative tasks for a ...
1
vote
2answers
65 views

What is/are the advantage(s) of running applications in backgound?

I really don't know what are the advantages of running applications in the background. Something like Application & via command line. Why exactly do we run applications in background and when ...
0
votes
1answer
48 views

What does “./” do? [duplicate]

I've got absolutely no idea what this does and if I search something like "linux ./ command", Google just seems to ignore those two characters as they're puntuation. If someone can give me a simple ...
0
votes
1answer
70 views

How to move system clock time forward/backward?

I know commands for setting specific time and/or date, but can't find ones which move the time relative to the current time. What are the commands to move the time forward/backward x ...
1
vote
1answer
89 views

Linux split separate files on disk but see as one

Is there is a functionality in Linux that allows you to reference multiple files as one? For example: linux.txt.0, linux.txt.1, linux.txt.2, linux.txt.3 can be seen as separate files or as linux.txt ...
0
votes
3answers
178 views

Can dash replace bash as my default shell?

From what I read, dash can be made as a shell by using the command ~$ chsh shirish Password: Changing the login shell for shirish Enter the new value, or press ENTER for the default Login Shell ...
1
vote
1answer
69 views

Linking a static library when compiling a C program

I'm linking *.a file with *.c file, so I have used the following command: gcc abc.c -l ad.a (here abc is the C source file and ad is the static library file) then after executing the following ...
0
votes
1answer
68 views

How can I convert this excel file so that it is not only one row?

I've got an Excel file, shown in the picture below, and available for download here. What I need is to extract the variables under Item (Column B) and the values in column G. As a start, I tried ...
0
votes
1answer
33 views

What is (and how to perform) action listing?

After performing a series of actions in Linux's terminal, I am supposed to perform a "listing" of them. I couldn't find it online. All I can guess is that I am supposed to make the terminal print out ...
1
vote
0answers
32 views

How to abort/cancel a running command in initramfs?

When I invoke a long-running command, e.g. du, I don't see a way to abort/cancel it (Strg/Ctrl+c doesn't work), other shells/ttys aren't available. Am I completely doomed after having started a long ...
0
votes
2answers
54 views

Copy a file in Nautilus and use it in a shell command line

Suppose I click on a file in Nautilus. How can I copy the full address to the clipboard, and then easily paste it into a shell command that I'm typing in a terminal?
0
votes
1answer
80 views

Scripts to E-mail Myself a File

The following command e-mails myself a file: sudo mail -a FILE_ADDRESS -s "Subject of E-mail" myemail@gmail.com Question: How do I turn this command into a one-liner, so that I could just type ...
0
votes
2answers
375 views

Access USB drive on Ubuntu server

I'm currently using a Ubuntu 14.04 server with command line access only. My .html files are on my Windows and I want to transfer them. What is the path in my Ubuntu server to get into my external ...
0
votes
1answer
611 views

Kali linux throws ' isolinux.bin missing or corrupt ' error

I downloaded Kali Linux from this link, I have a 32 bit OS, so I guessed ISO 32 Kali Linux is the suitable for me (they did not clarify in the website based on what we choose the type). Then, I ...
1
vote
3answers
106 views

Securely passing user input to command

I have a daemon daemon running in Server A. There, there's an argument based script to control the daemon daemon_adm.py (Server A). Through this script I can insert "messages" to daemon coming from ...
1
vote
1answer
42 views

View timestamp for CUPS print jobs

I'm looking for a way to view the timestamp of a job in CUPS. I've searched the man pages and can't seem to find it. The long term goal is to have a script that parses the time from the jobID and ...
5
votes
1answer
284 views

combining find with other commands: when to use -exec and when to use pipe? [duplicate]

I've learned to use the find command by itself to find files and directories however when it comes to doing something with the files/folders I'm confused. Given the following command: find . -type f ...
2
votes
1answer
39 views

w command for the other network hosts

While the who command refers to the local machine, rwho shows the same informations about all the known hosts of the local network. Similarly, w shows informations about the users on the local ...
3
votes
5answers
1k 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?
24
votes
8answers
2k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually ...
2
votes
2answers
38 views

How-to overwrite directory on multiple places with 1 source directory

So today I encountered one of my PHP files was outdated so I've got to overwrite the phpthumb directory on the entire server. Multiple websites use this folder on multiple unknown locations, so how ...
2
votes
1answer
225 views

How to remove file log with file name

Assume, I have log files with this name format. NameLog.log.2014-09-27 NameLog.log.2014-09-28 NameLog.log.2014-09-29 NameLog.log.2014-09-30 NameLog.log.2014-10-01 NameLog.log.2014-10-02 ...
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 ...
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 ...
0
votes
3answers
32 views

Assigning files key words to easily find them later

Suppose I have a file. This file is stored in some complex location (within a hundred subfolders), but I nevertheless use it a lot. Is there some way to assign this file a set of keywords (i.e., "my ...
7
votes
1answer
100 views

How to filter any part of description or option from manpage

I want to get output of any desired description or option from a man page. Example: I want to get the description for the autoclean option from the apt-get man page: Please suggest a command, ...
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?
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 ...
2
votes
4answers
144 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 ...
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 ...
17
votes
5answers
2k views

Why do I sometimes get repeatedly prompted with “>” in the terminal?

Alright, when I run certain commands the wrong way, (misspelled, etc.) The terminal outputs this: > instead of computername:workingfolder username$, and when I type enter it goes like this: > ...
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 ...
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
416 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 ...
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 ...
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 ...
0
votes
2answers
60 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 ...
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 ...
0
votes
0answers
26 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
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
285 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 ...