Skip to content
HUANG CHEN FANG edited this page Aug 11, 2017 · 12 revisions

Welcome to the my-study wiki!

$ sudo dhclient -r eth0
$ sudo dhclient eth0
### Other options in Linux to renew dhcp ###
$ ifdown eth0
$ ifup eth0
### RHEL/CentOS/Fedora specific command ###
$ /etc/init.d/network restart
### Debian / Ubuntu Linux specific command ###
$ /etc/init.d/networking restart
### nmcli command (NetworkManager) to renew IP address in Linux ###
nmcli con
nmcli con down id 'nixcraft_5G'
nmcli con up id 'nixcraft_5G'
  • HowTo: UNIX / Linux Convert DOS Newlines CR-LF to Unix/Linux Format
$ dos2unix -b myfile.txt                            # Convert DOS file to UNIX format
$ unix2dos -b myfile.txt                            # Convert UNIX file to DOS format
$ tr -d '\r' < input.file > output.file             # Convert Dos TO Unix Using tr Command
$ perl -pi -e 's/\r\n/\n/g' input.file              # Convert Dos TO Unix Using Perl One Liner
$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt   # Convert UNIX to DOS format using sed command
$ sed 's/^M$//' input.txt > output.txt              # Convert DOS newlines (CR/LF) to Unix format using sed command
  • How do I grant sudo privileges to an existing user?
$ sudo usermod -a -G sudo <username>

Clone this wiki locally