enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. 31. The dot-slash, ./, is a relative path to something in the current directory. The dot is the current directory and the slash is a path delimiter. When you give the command touch ./a you say "run the touch utility with the argument ./a ", and touch will create (or update the timestamp for) the file a in the current directory.

  3. 1024. More precisely, a double dash (--) is used in most Bash built-in commands and many other commands to signify the end of command options, after which only positional ("non-option") arguments are accepted. Example use: Let's say you want to grep a file for the string -v.

  4. bash - How to make a for loop in command line? - Unix & Linux...

    unix.stackexchange.com/questions/377979/how-to-make-a-for-loop-in-command-line

    The syntax of a for loop from the bash manual page is. for name [ [ in [ word ... ] ] ; ] do list ; done. The semicolons may be replaced with carriage returns, as noted elsewhere in the bash manual page: "A sequence of one or more newlines may appear in a list instead of a semicolon to delimit commands." However, the reverse is not true; you ...

  5. An uncomment command can be created analogously. Advanced feature. sed's line selection is quite powerful. In addition to specifying first and last lines by number, it is also possible to specify them by a regex. So, if you want to command all lines from the one containing foo to the one containing bar, use: comment '/foo/,/bar/' bla.conf

  6. From cat's man page: cat - concatenate files and print on the standard output. Now cat is fine for printing files but there are alternatives: echo "$(<filename)" or. printf "%s" "$(<filename)" The ( ) return the value of an expression, in this case the content of filename which then is expanded by $ for echo or printf.

  7. scripting - How to get whole command line from a process? - Unix...

    unix.stackexchange.com/questions/163145/how-to-get-whole-command-line-from-a...

    How can I get the command arguments or the whole command line from a running process using its process name? For example this process: # ps PID USER TIME COMMAND 1452 root 0:00 /sbin/udhcpc -b -T 1 -A 12 -i eth0 -p /var/run/udhcpc.eth0.pid

  8. Linux: set date through command line - Unix & Linux Stack...

    unix.stackexchange.com/questions/151547

    You change the date with the date command. However, the command expects a full date as the argument: # date -s "20141022 09:45" Wed Oct 22 09:45:00 BST 2014 To change part of the date, output the current date with the date part that you want to change as a string and all others as date formatting variables.

  9. 13. To switch the terminal session to a different user, where that user can't exit back into the original user, use exec: $|# exec su - [username] This will technically login the new user in a new term process, and close out the current one. That way when the user attempts exit or Ctrl-D, the terminal will close as though that user was the one ...

  10. How do you time how long a command took to run? [duplicate]

    unix.stackexchange.com/questions/86632/how-do-you-time-how-long-a-command-took...

    the example output above is from the bash builtin. time is a builtin command in most shells. there is also the system time. it has a different output format but otherwise behaves mostly the same as the shell builtin. to use the system command you do it like this: $ /usr/bin/time somecommand --what=islove. or.

  11. 255. You can use kill to stop the process. For a 'polite' stop to the process (prefer this for normal use), send SIGTSTP: kill -TSTP [pid] For a 'hard' stop, send SIGSTOP: kill -STOP [pid] Note that if the process you are trying to stop by PID is in your shell's job table, it may remain visible there, but terminated, until the process is fg 'd ...