Sponsored Content
Full Discussion: I misused: "sudo rm -rf /*"
Top Forums UNIX for Beginners Questions & Answers I misused: "sudo rm -rf /*" Post 303030026 by SuchtyTV on Monday 4th of February 2019 06:32:55 PM
Old 02-04-2019
I misused: "sudo rm -rf /*"

Hey Guys,

I have literally shot my myself in the head...
I tried to use "sudo rm -rf /*" in Terminal (OSX); Unfortunately, I forgot cd Desktop.
After I realized it, I was like Smilie

After that i tried exit; but rm was a background command, so this did not work either...
I came to late for sudo kill 1...

It seems like half of the drive is deleted, Even OS is corrupted. Is there a Way restoring the Data from an SSD card?

Your sincerely,
Niclas
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:... (1 Reply)
Discussion started by: Chloe123
1 Replies

3. UNIX for Dummies Questions & Answers

changing password with sudo user " permission denied"

HI All, I am using solaris i created a user adam and updated his permissions in vi sudoers file as follows adam ALL=(ALL) NOPASSWORD: ALL ........... when i create user by logging as sudo user . $ sudo useradd -d /home/kalyan -m -s /bin/sh kalyan sudo: not found ... (6 Replies)
Discussion started by: kalyankalyan
6 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

7. Shell Programming and Scripting

Explaining behaviour of sudo bash "$0" "$@";

I've found this script part on the stackoverflow: if ; then sudo bash "$0" "$@"; exit "$?"; fi I realized that sudo bash "$0" "$@"; is the only needed for me. But the strange thing happens when I move this line outside the IF statement: sudo bash "$0" "$@"; stops the... (9 Replies)
Discussion started by: boqsc
9 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
NFSTEST.HOST(1) 						nfstest.host 1.0.1						   NFSTEST.HOST(1)

NAME
nfstest.host - Host module DESCRIPTION
Provides a set of tools for running commands on the local host or a remote host, including a mechanism for running commands in the back- ground. It provides methods for mounting and unmounting from an NFS server and a mechanism to simulate a network partition via the use of 'iptables'. Currently, there is no mechanism to restore the iptables rules to their original state. CLASSES
class Host(baseobj.BaseObj) Host object Host() -> New Host object Usage: from nfstest.host import Host # Create host object for local host x = Host() # Create host object for remote host y = Host(host='192.168.0.11') # Run command to the local host x.run_cmd("ls -l") # Send command to the remote host and run it as root y.run_cmd("ls -l", sudo=True) # Run command in the background x.run_cmd("tcpdump", sudo=True, wait=False) .... .... # Stop command running in the background x.stop_cmd() # Mount volume using default options x.mount() # Unmount volume x.umount() Methods defined here: --------------------- __init__(self, **kwargs) Constructor Initialize object's private data. host: Hostname or IP address [default: localhost] user: User to log in to host [default: ''] server: NFS server name or IP address [default: None] nfsversion: NFS version [default: 4] minorversion: NFS minor version [default: 1] port: NFS server port [default: 2049] export: Exported file system to mount [default: '/'] mtpoint: Mount point [default: '/mnt/t'] datadir: Data directory where files are created [default: ''] mtopts: Mount options [default: 'hard,rsize=4096,wsize=4096'] interface: Network device interface [default: 'eth0'] nomount: Debug option so the server is not actually mounted [default: False] iptables: Iptables command [default: '/usr/sbin/iptables'] sudo: Sudo command [default: '/usr/bin/sudo'] mount(self, **kwargs) Mount the file system on the given mount point. server: NFS server name or IP address [default: self.server] nfsversion: NFS version [default: self.nfsversion] minorversion: NFS minor version [default: self.minorversion] port: NFS server port [default: self.port] export: Exported file system to mount [default: self.export] mtpoint: Mount point [default: self.mtpoint] datadir: Data directory where files are created [default: self.datadir] mtopts: Mount options [default: self.mtopts] Return the mount point. network_drop(self, ipaddr, port) Simulate a network drop by dropping all tcp packets going to the given ipaddr and port using the iptables commands. network_reset(self) Reset the network by flushing all the chains in the table using the iptables command. run_cmd(self, cmd, sudo=False, dlevel='DBG1', msg='', wait=True) Run the command to the remote machine using ssh. There is no user authentication, so remote host must allow ssh connection without any passwords for the user. For a localhost the command is just executed and ssh is not used. The object for the process of the command is stored in object attribute 'self.process' to be used by methods wait_cmd() and stop_cmd(). The standard output of the command is also stored in the object attribute 'self.pstdout' while the standard error output of the command is stored in 'self.pstderr'. cmd: Command to execute sudo: Run command using sudo if option is True dlevel: Debug level for displaying the command to the user msg: Prefix this message to the debug message to be displayed wait: Wait for command to complete before returning Return the standard output of the command and the return code or exit status is stored in the object attribute 'self.returncode'. stop_cmd(self, process=None, dlevel=None, msg='') Terminate command started by run_cmd() by calling wait_cmd() with the 'terminate' option set to True. process: The object for the process of the command to terminate, or terminate all commands started by run_cmd() if this option is not given dlevel: Debug level for displaying the command to the user, default is the level given by run_cmd() msg: Prefix this message to the debug message to be displayed Return the exit status of the last command sudo_cmd(self, cmd) Prefix the SUDO command if effective user is not root. umount(self) Unmount the file system. wait_cmd(self, process=None, terminate=False, dlevel=None, msg='') Wait for command started by run_cmd() to finish. process: The object for the process of the command to wait for, or wait for all commands started by run_cmd() if this option is not given terminate: If True, send a signal to terminate the command or commands and then wait for all commands to finish dlevel: Debug level for displaying the command to the user, default is the level given by run_cmd() msg: Prefix this message to the debug message to be displayed Return the exit status of the last command Static methods defined here: ---------------------------- get_ip_address(host='', ipv6=False) Get IP address associated with the given host name. This could be run as an instance or class method. SEE ALSO
baseobj(1) BUGS
No known bugs. AUTHOR
Jorge Mora (mora@netapp.com) NFStest 1.0.2 10 April 2013 NFSTEST.HOST(1)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy