The tag has no usage guidance.

learn more… | top users | synonyms

31
votes
4answers
62k views

Nginx enable site command

We all know how to enable a website using apache on linux. I'm pretty sure that we all agree on using the a2ensite command. Unfortunately there is no default equivalent command comes with Nginx, but ...
19
votes
3answers
3k views

What is /usr/bin/[?

I was just poking around in /usr/bin and I found an ELF binary file called [. /usr/bin/[. I have never heard of this file and my first thought was that it was a clever way of hiding a program, ...
20
votes
3answers
33k views

How to check if a RSA public / private key pair matched

I have two files, id_rsa and id_rsa.pub, what command can be used to validate if they are the valid pair.
-1
votes
2answers
26 views

Debian statistics - cpu, memory, hdd

I'm wondering how can I get my dedicated server avarage statistics for last month/ week. I used sysstat and sar to report my logs, but they are seems to be too much I'm interested about averege final ...
0
votes
0answers
18 views

Run a script if another process was spotted

I have CentOS 7 and looking for a sollution about a small issue. I want to have a sudo script to be run but only if the system executed a specific command remotely. For example: I've put my command ...
0
votes
0answers
32 views

Delete files older than x days permissions

I have a folder that I have to run the following script find folder/ -ctime +7 -exec rm {} \; To delete files in the folder older then x days. But I can't let the root user do that, there will be a ...
0
votes
1answer
31 views

SUDO command only works as root (Solaris 10)

After installing sudo in the system i am unable tu run sudo as a non-root user, when i try to execute any command i get: /usr/local/bin/sudo: cannot execute if i edit /etc/passwd to use a different ...
0
votes
1answer
68 views

Windows PowerShell - How to view commands history date/time [closed]

I want to list entered commands in Windows PowerShell with their respective timestamps. How can I do it with Get-History command? Also if that isn't doable then please show me a way to check which ...
0
votes
0answers
16 views

node forever node cleaning up properly - lingering processes

I have the following sshTunnel.js file (it's a very simple ssh tunnel listening locally on port 8080): #!/usr/local/bin/node var cmd = 'ssh -C2qTnN -D 8080 eamorr@myserver.com'; ...
3
votes
1answer
96 views

How to find the ip address of the pc that sent a shutdown command?

I'm a system administrator in a school. We have a classroom with 20 PC's in a domain, and all PC's use the same user to log in. Sometimes students use the shutdown command to shut down the PC's of ...
3
votes
2answers
108 views

SSH authorized_keys command option: multiple commands?

The authorized_keys has a command="..." option that restricts a key to a single command. Is there a way to restrict a key to multiple commands? E.g. by having a regex there, or by editing some other ...
4
votes
3answers
9k views

Can I run a shell built-in command with Puppet?

I want ~/.bashrc will be source whenever changing its content. I created a bashrc class with something like this: file { "/root/.bashrc": ensure => present, owner => root, group ...
0
votes
1answer
43 views

What does '— --daemon' mean in start-stop-daemon?

On this man page for start-stop-daemon, there is an example: start-stop-daemon --start --oknodo --user food --name food --pidfile \ /var/run/food.pid --startas /usr/sbin/food --chuid food -- ...
0
votes
0answers
41 views

Packet Tracer 6.1.1 ISAKMP command not available

I am just going around in circles trying to configure a site to site VPN using the CLI on the ASA 5505 in Packet Tracer 6.1.1 When I am configuring isakmp the command just do not seem to be abailable ...
-2
votes
1answer
1k views

where is systemctl command in redhat 6.6 64 bit OS?

I was trying to run status of network by following commands. sudo systemctl status network However the system says systemctl command not found.
1
vote
1answer
16k views
0
votes
0answers
18 views

Replace exact rows from some .js files with some other rows from another file

I have a situation where i need to change some encoded text (or better, an entire row) on some .js files on my server. What i think that will be better is a way to remove entire row (ex: row 2 and ...
3
votes
5answers
2k views

fdisk - partition in single line

Can you create a partition in a usb disk using fdisk command in a single line. fdisk command is interactive in nature, But I want to automate partition creation in a single line using fdisk command.
0
votes
2answers
137 views

How to take backup of a table on a different schema in PostgreSQL

Please let us know in PostgreSQL how we can take backup of a table on a different schema. We have db named "geopostgrest" and under Schema named "1" (Not inside Public Schema) we need to take backup ...
10
votes
5answers
4k views

Pass a pipe to a command that expects a filename

Say I have a command foo which takes a filename argument: foo myfile.txt. Annoyingly, foo doesn't read from standard input. Instead of an actual file, I'd like to pass it the result of another command ...
1
vote
1answer
94 views

Command substitution into bash script $1 value

I have this simple script which changes permissions on my apache2 websites /var/www/html# cat permissions_setup.sh chown -R root $1 chgrp -R www-data $1 chmod -R 750 $1 chmod g+s $1 I have two .sh ...
11
votes
2answers
12k views

Command to create MySQL database with Character set UTF-8

I use create database dbname; to create database. but I want it to created with Character set UTF-8 Anyone know what is the command to use?
0
votes
1answer
15 views

run remote command to save debian package list

I'd like to backup the package list(dpkg) of some remote computers to a backup server: all of them running Debian. I already configured the rsa key to login remotely as root on the other computers ...
0
votes
2answers
80 views

how to identify a command prompt window?

Enviroment: windows 7 Currently i have machine on which we launch 2 batch files on system start up. These batch files internally run multiple programs by running on separate command prompt windows. ...
-1
votes
1answer
52 views

Search for file names containing space

I have a batch file that helps me in install multiple pieces of software from a shared folder. It's working well with software whose names don't contain spaces, but I need it to work with software ...
1
vote
2answers
41 views

How to cp only into the latest directory name?

mkdir test_dir test_dir1 test_dir2 test_dir3 touch file1 file2 file3 cp -v file* test_dir*/ This copies only to test_dir3 and not in test_dir, test_dir1, test_dir2. Why? For that matter it copies ...
0
votes
3answers
201 views

How to find which folder is eating space fast? [duplicate]

I am running Linux server, we using this server as a samba share drive. From yesterday suddenly, one of the share drive size getting increasing (~ 100 MB every ten min). There are too many folders and ...
2
votes
3answers
108 views

Output of a command to the first line of a file

I am trying to insert output of a command into the first line of a file. For example, I have a file named "list.txt" and want to insert a text containing all the file names in that folder. A way to ...
6
votes
4answers
7k views

PowerShell script, showing commands run

I am playing around with PowerShell scripts and they're working great. However, I am wondering if there is any way to also show all the commands that were run, just as if you were manually typing ...
1
vote
1answer
1k views

Issue command on multiple systems at once using MCollective

Aim The aim is to execute a command on multiple systems at once using MCollective, e.g., touch /tmp/helloworld using MCollective-client creates touch /tmp/helloworld on all MCollective-servers: ...
11
votes
3answers
5k views

Linux: cat with separators among files

In Linux if you type cat *, you will get something like this: line1 from file1 line2 from file1 line1 from file2 line1 from file3 line2 from file3 line3 from file3 What I would like is to display ...
1
vote
1answer
512 views

mysql won't run from command line

When trying to run the /etc/bin/mysql command from the command line, I'm returned to the prompt without any action. Restarting mysql via /etc/init.d/mysql restart shows the following error during the ...
2
votes
2answers
2k views

Meaning of killall -0

I see from many place the follow command is used to check if a process exists, e.g. killall -0 nginx But from the documentation I can't see anything related to this argument, can anyone explain?
-2
votes
1answer
64 views

How to get a process ID automaticly with command prompt [closed]

I´d want to know how to get a PID of a process with a single command in command prompt. I tried it with findstr, but I´m (apparently) not so smart to figure it out. You cannot use tasklist, because ...
3
votes
1answer
639 views

Meaning of requeues of tc command

I ran this tc bellow and it outputs requeues with high number, do you know what this requeues means? By the way, it keeps increasing over the time. I look at man tc but I couldn't find anything. $ ...
1
vote
1answer
576 views

Command apt-get -t wheezy-backports install linux-image-amd64

I have a server with Debian wheezy and kernel vmlinuz-3.2.0-4-amd64, hosted at OVH. I would like to upgrade the kernel. Normally at ovh, you can find some kernel already configured. but the files I ...
5
votes
1answer
2k views

Installing a php extension (xdiff) from pecl on Linux

I was getting this error on my php script: Fatal error: Call to undefined function xdiff_file_diff() I realised that I didn't had the xdiff extension installed. When I tried to install it using the ...
4
votes
6answers
3k views

Same command on multiple servers

I'm just wondering if there is any fellow sysadmin with the need to execute one command on multiple servers. If so, what technique are you using? I have grown tired to ssh-ing to 3-5 servers and ...
31
votes
6answers
70k views

Is there a global, persistent CMD history?

Sometimes I forget how the exact syntax of a CMD command looks and then I would like to search my own CMD history. Clearly, within the same session, you can browse it with the up and down arrow keys ...
1
vote
1answer
77 views

dsget error probably because of users with “-” in their name

I'm trying to run a dsquery/dsget that will result in users that weren't active for a month and that are not disabled: dsquery user -inactive 4 -limit 0 | dsget user -samid -disabled ...
1
vote
2answers
393 views

Can I find the list of ports being listened by a process ordered by the time of opening?

I know I can see the list of open ports using the lsof command. I am trying to view the results ordered by timestamp of listening. The process opens multiple (~6) ports and I suspect the order of ...
2
votes
2answers
4k views

why does sudo su; su tomcat doesn't switch to tomcat user?

In Redhat linux. from my user if I issue command sudo su -> changes to root su tomcat --> changes to tomcat user Why does tailing the commands in single line doesn't work? sudo su; su tomcat --> stil ...
-1
votes
2answers
384 views

can't find the executable for the command linux 'source' [closed]

i am using ubuntu server 12.04 lts. I am looking for the executable of the linux command source i can not find in the /bin nor /usr/bin nor /usr/sbin nor /usr/local/bin . I used whereis source it ...
0
votes
1answer
259 views

task manager performance tab

I am trying to have task manager open on the Performance tab on startup on Windows 8, 8.1, and 2012 machines. I have gotten the task manager to open, but it always does so on the Processes tab and ...
4
votes
4answers
2k views

Handy parsing for numbers with unit suffixes?

Let's say you have data with quantities in human-readable format, such as the output of du -h, and want to further operate on those numbers. Let's say you want to pipe your data through grep to do a ...
2
votes
2answers
113 views

how to browse a folder named '-' in linux machine

I have created a directory named - [root@server50 public_html]# mkdir - [root@server50 public_html]# ls -al drwxr-xr-x 2 root root 4096 2011-03-16 02:22 - How can I enter the directory ...
2
votes
1answer
328 views

Bash: two commands in dollar-parenthesis don't have same behavior

I don't undertsand why, in Bash: echo $(hostname --fqdn) works, echo $(id -un) doesn't (id: –un: No such user). Backticks give the same results. Is there some good practice for using this ...
1
vote
2answers
874 views

How to check that all ZFS snapshots within a pool are without holds before destroying that pool

Question Already I can check each snapshot of a filesystem individually, manually. I would prefer to check all at once (all with a single command or script). Please: can that be done with a ...
1
vote
1answer
1k views

Can sftp check for existing data?

I have 700 binary files (pdf) to download and right now only 400 are available on a sftp server. Can sftp, from the cli, determine what files exist in the local directory so it doesn't need to ...
0
votes
0answers
285 views

Need help getting two commands to run on startup (Seafile)

Trying to get the Dropbox alternative Seafile to run automatically on startup on my VPS running on CentOS 6.4. I want to get these two commands on startup. Noob here, any help will be really ...