To remove a directory in Linux, you can use the rm command with the -r flag, which stands for “recursive.” This flag allows you to delete a directory and its contents. Here’s the command you can use:
rm -r directory_name
Replace directory_name with the actual name of the directory you want to remove.
Please exercise caution when using the rm command with the -r flag, as it permanently deletes files and directories. Make sure you double-check the directory you want to delete before executing the command.
The different rm command options include:
-f: Forces the removal of all files and directories.
-i: Prompts for confirmation before removing.
-I: Prompts once before removing more then three files or when removing recursively.
-r: Removes directories and their content recursively.
-d: Removes empty directories.
-v: Provides a verbose output.
–help: Displays the help text.
–version: Displays the command version.
I hope this helps someone, have a wonderful afternoon.
I ran into some issues with the latest Windows 10 update 2004. It was causing their file browser to freeze when opening. I tried multiple times to unmount using “Net use ‘drive/unc’ /delete /y”. So I finally ran across an article about using MOUNTVOL to remove volume mount point directories and registry settings. It worked like a charm, so I figured I would post this.
path specifies the existing NTFS directory where the mount point will reside. VolumeName Specifies the volume name that is the target of the mount point. /D Removes the volume mount point from the specified directory. /L Lists the mounted volume name for the specified directory. /P Removes the volume mount point from the specified directory, dismounts the volume, and makes the volume not mountable. You can make the volume mountable again by creating a volume mount point. /R Removes volume mount point directories and registry settings for volumes that are no longer in the system. /N Disables automatic mounting of new volumes. /E Re-enables automatic mounting of new volumes.
I wanted to compile a list of ShoreTel/Mitel mute codes so I don’t have to head to duckduckgo every time I can’t remember one. I also hope this helps someone else!
To Clear Cached Values + CLEAR (25327) #
To Reset A Phone + RESET (73738) #
To Enter Setup + SETUP (73887) #
View Current Configuration Settings + INFO (4636) #
Alright, so as I wanted to post some basic group commands in Linux. Since it’s not an operating system I use full time I have a hard time remembering little things; so I figured I’d create a little post.
Now let’s open a terminal and have some fun.
Adding a Existing User Account to a Group….
sudo usermod -a -G yourgroup yourusername
Add a New Group
sudo groupadd thenewgroup
Viewing the Groups a User Account is a Member of
groups
or if you want numerical ID’s associated with your groups
id
Creating a New User and Assigning him/her to a Existing Group
Verify current settings on switch if any and remove them if found.
Switch Setup
Setting up your hostname
Setting up Telnet
Configuring your enable password
Encrypting your passwords
Setting up your switch IP Address
Setting up Default Gateway
Saving your configuration
Basic port configuration
Setting up access ports
Setting up a Trunk port
Using the Range command
Accessing the Switch:
We need to connect to the switch using either a Cisco USB cable or a console cable with a usb-serial adapter. Most computers today do not come with a serial port anymore so I recommend purchasing a usb-serial adapter. You can find these pretty cheap on Amazon or Ebay
After you have installed the drivers for your usb-serial adapter, we need to setup putty to communicate with the switch. I’m going to be using the below setting for my switch.
Command Modes:
Mode
Symbol
Accessing mode
Exiting mode
User Exec Mode
Switch>
Default Mode, basic show command available
Exit
Privileged EXEC Mode
Switch#
The “Enable” command will move you into this mode
Exit
Global Configuration Mode
Switch(config)#
“Configure Terminal” or “Config t” command from Privileged mode
Exit or Ctrl + Z to move back to EXEC mode
Interface Configuration
Switch(config-fi)#
Use Interface (interface name+number> command from global configuration mode
Exit will move you back to global mode, END will move you back to Privileged mode Switch#
Verify current settings on the Switch:
So, I like to verify the switch is in a fresh configuration, meaning that the switch is in it’s default factory state. If you are unsure I would delete the configurations and reload the switch.
Steps to reload a switch……
Configuring the Switch Hostname:
Alright, let’s move from EXEC mode -> Privileged Mode, (EN or Enable) -> Configure Terminal (Config T). Now type the following command -> Hostname “NAME”.
Switch# hostname 3560-24
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname 3560-24
3560-24(config)#
3560-24(config)#
3560-24(config)#
We should now see the CLI change from SWITCH# to 3560-24#
Setting up Telnet:
Alright let’s move into the Global Configuration mode, then into Interface Configuration.
3560-24>en
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#line con 0
We will now be setting line CON 0 with a password and login rights
3560-24>en
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#line con 0
3560-24(config-line)#password cisco
3560-24(config-line)#login
Now lets jump right from CON 0 into VTY 0 4 (Telnet Lines 0 thru 4) and setup the password and login commands.
After we have set both of these up, I like to exit the switch and test to make sure that we can at least get back into the switch before we save to configuration.
Alright, everything is looking good so let’s configure the Enable password. We will move back into Privileged EXEC mode then into Global configuration mode. Using the command “enable secret <password>” will make our password encrypted. This command does not encrypt our VTY and Con 0 passwords, so we will also run the command “Service Password-Encryption”
3560-24>en
3560-24#config t
3560-24(config)#enable secret cisco
3560-24(config)#service password-encryption
3560-24#exit
Now before you save your configuration. I like to logout and login to verify all passwords are working correctly. Now if you use the command “show running-config” we should see that our enable passwords and line passwords are encrypted.
Setting the Switches IP Address:
We are going to be starting from the EXEC mode and move to the Interface Configuration mode.
3560-24>enable
Password:
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#int Vlan 1
3560-24(config-if)#
Now lets configure Vlan 1 with an IP Address and enable the interface.
3560-24(config)#int vlan 1
3560-24(config-if)#ip address 10.10.10.1 255.255.255.0
3560-24(config-if)#no shutdown
3560-24(config-if)#
17:04:18: %LINK-3-UPDOWN: Interface Vlan1, changed state to up
Now that we have an IP Address on the switch, I also like to setup a default-gateway just in case we have other subnets on our network we need to talk too. If all your devices are on Vlan 1 then you don’t have to do this, but I would highly suggest you do.
3560-24(config)#ip default-gateway 10.10.10.254
Verifying the gateway
3560-24#sh ip route
Default gateway is 10.10.10.254
Host Gateway Last Use Total Uses Interface
ICMP redirect cache is empty
3560-24#
Saving your Configuration:
Saving your Configuration by either entering “wr” or “copy running-config startup-config”
3560-24#wr
Building configuration...
[OK]
or
(This is the Cisco preferred method)
3560-24#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
3560-24#
Alright, let’s move on to configuring our interfaces with some basic settings.
Basic Access Port:
The two commands we are going to use are “Switchport mode access” and “Switchport access vlan <number>”. The “switchport mode access” command disables DTP – Dynamic Trunking Protocol on the specified interface, which basically turns off trunk negotiation.
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#int fa0/1
3560-24(config-if)#switchport mode access
3560-24(config-if)#switchport access vlan 1
3560-24(config-if)#
Now lets verify our configuration, you will not see “switchport access vlan 1” as it already in Vlan 1, but if we had configured Vlan 10 we would see it on the port config. By default all ports are in Vlan 1 unless otherwise configured.
Vlan 1:
Vlan 10:
I also like to setup “Spanning-tree Portfast” so the port will come up as fast as possible. You will see a warning message when you enter this command, as it’s important to know not to configure “Portfast” if you are connecting this port to other Hubs, Switches, etc.
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#int fa0/1
3560-24(config-if)#spanning-tree portfast
Here is a screenshot of the warning and the now configured port.
Basic Trunk Port:
This is a basic Trunk port configuration if you have multiple Vans and are needing them to pass to another switch. I’m not going to get into much about trunk ports as I’ll be doing another post and video on this topic, but the below commands will configure a trunk port and pass all configured vlans thru the port.
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#int fa0/2
3560-24(config-if)#switchport trunk encapsulation dot1q
3560-24(config-if)#switchport mode trunk
3560-24(config-if)#end
Verifying configuration:
Extra Knowledge:
If you want to configure multiple ports at one time you can use the “Interface Range” command to select contiguous ports.
3560-24#config t
Enter configuration commands, one per line. End with CNTL/Z.
3560-24(config)#int range fa0/3 - 10
3560-24(config-if-range)#switchport mode access
3560-24(config-if-range)#switchport access vlan 10
3560-24(config-if-range)#spanning-tree portfast
You can verify your config using “show running-config” and we will see all the ports configured.