SlideShare uma empresa Scribd logo
1 de 2
if i want to remove all the files in my current working directory using UNIX , i have a script and
one of thie lines of this script is rm -rf /*Â Â would this work ? please explain why or why not
?? this is in C
what is the type of the parameter argv to the main funtion in a C proggram ?
Solution
UNIX rm command
rm-remove directory that removes files and directories.
The parameters of rm command is as follows
rm -rf
where r refers to remove files and directories recursively if contains
nested directories.
f refers to forcibly delete the directories and file if not exists
without prompt user to choose the decision about the file or directory.
argv is a parameter name of the character string that takes an
array of string arguments from main method of c program.
---------------------------------------------------------------------------------------------------------------------
---
//Sample program that demonstrates the use of argv vector array
//test.c
#include<stdio.h>
#include<conio.h>
//main function
int main(int argc, char * argv)
{
//Assign the argc to count
int count=argc;
int index;
//argv[0] represents the name of the program, test.c
//prints the strings in argv
for(index=1;index<count;index++)
printf("%s ",argv[index]);
//pause program output on console.
system("pause");
return 0;
}
Sample output:
C:test.c hello c world
output: hello c world

Mais conteúdo relacionado

Semelhante a if i want to remove all the files in my current working directory usin.docx

Introduction to c
Introduction to cIntroduction to c
Introduction to camol_chavan
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands Raghav Arora
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake TutorialFu Haiping
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsBrendan Gregg
 
Systemtap
SystemtapSystemtap
SystemtapFeng Yu
 
Msfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetMsfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetCe.Se.N.A. Security
 
Emacs presentation
Emacs presentationEmacs presentation
Emacs presentationLingfei Kong
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1Gourav Varma
 
Unit 5 quesn b ans5
Unit 5 quesn b ans5Unit 5 quesn b ans5
Unit 5 quesn b ans5Sowri Rajan
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Ranjan Raja
 
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL DevroomFlame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL DevroomValeriy Kravchuk
 

Semelhante a if i want to remove all the files in my current working directory usin.docx (20)

Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 
The Stack Frame
The Stack FrameThe Stack Frame
The Stack Frame
 
Perl 20tips
Perl 20tipsPerl 20tips
Perl 20tips
 
Group13
Group13Group13
Group13
 
Restore
RestoreRestore
Restore
 
Readme
ReadmeReadme
Readme
 
Systemtap
SystemtapSystemtap
Systemtap
 
Msfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheetMsfpayload/Msfencoder cheatsheet
Msfpayload/Msfencoder cheatsheet
 
Emacs presentation
Emacs presentationEmacs presentation
Emacs presentation
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Unit 5 quesn b ans5
Unit 5 quesn b ans5Unit 5 quesn b ans5
Unit 5 quesn b ans5
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
 
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL DevroomFlame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
Flame Graphs for MySQL DBAs - FOSDEM 2022 MySQL Devroom
 

Mais de edwardk6

Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docx
Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docxIdentify which of the following is NOT a TCP-IP Attack- Question 5 opt.docx
Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docxedwardk6
 
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docx
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docxIdentifying Matter- Physical Properties (Section 1-4 15- The elements.docx
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docxedwardk6
 
Identifying aclds and bases by their reaction with water Kri Some chem.docx
Identifying aclds and bases by their reaction with water Kri Some chem.docxIdentifying aclds and bases by their reaction with water Kri Some chem.docx
Identifying aclds and bases by their reaction with water Kri Some chem.docxedwardk6
 
Identify the two primary sources of stockholders equity- and which sou.docx
Identify the two primary sources of stockholders equity- and which sou.docxIdentify the two primary sources of stockholders equity- and which sou.docx
Identify the two primary sources of stockholders equity- and which sou.docxedwardk6
 
If you had a system- that had large amounts of daily data inflows- tha.docx
If you had a system- that had large amounts of daily data inflows- tha.docxIf you had a system- that had large amounts of daily data inflows- tha.docx
If you had a system- that had large amounts of daily data inflows- tha.docxedwardk6
 
If two points are in a common reference frame- then a They are not in.docx
If two points are in a common reference frame- then a They are not in.docxIf two points are in a common reference frame- then a They are not in.docx
If two points are in a common reference frame- then a They are not in.docxedwardk6
 
Identify at least two types of system architectures that work well in.docx
Identify at least two types of system architectures that work well in.docxIdentify at least two types of system architectures that work well in.docx
Identify at least two types of system architectures that work well in.docxedwardk6
 
Identify and prioritize information assets- Identify and prioritize th.docx
Identify and prioritize information assets- Identify and prioritize th.docxIdentify and prioritize information assets- Identify and prioritize th.docx
Identify and prioritize information assets- Identify and prioritize th.docxedwardk6
 
If the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docxIf the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docxedwardk6
 
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docx
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docxE13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docx
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docxedwardk6
 
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docx
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docxE 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docx
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docxedwardk6
 
During October- Wichita Light Company experiences the following transa.docx
During October- Wichita Light Company experiences the following transa.docxDuring October- Wichita Light Company experiences the following transa.docx
During October- Wichita Light Company experiences the following transa.docxedwardk6
 
During a total lunar eclipse- in which the moon passes entirely into t.docx
During a total lunar eclipse- in which the moon passes entirely into t.docxDuring a total lunar eclipse- in which the moon passes entirely into t.docx
During a total lunar eclipse- in which the moon passes entirely into t.docxedwardk6
 
During 2011- Arthur Corportation reported a net income of $3-059-000-.docx
During 2011- Arthur Corportation reported a net income of $3-059-000-.docxDuring 2011- Arthur Corportation reported a net income of $3-059-000-.docx
During 2011- Arthur Corportation reported a net income of $3-059-000-.docxedwardk6
 
Driving School has 4 learning centres- The network of each learning ce.docx
Driving School has 4 learning centres- The network of each learning ce.docxDriving School has 4 learning centres- The network of each learning ce.docx
Driving School has 4 learning centres- The network of each learning ce.docxedwardk6
 
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docx
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docxDonnie Hilfiger has two classes of stock authorized- S1 par preferred.docx
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docxedwardk6
 
Doris Washington recently assumed her new position as HR Director at t.docx
Doris Washington recently assumed her new position as HR Director at t.docxDoris Washington recently assumed her new position as HR Director at t.docx
Doris Washington recently assumed her new position as HR Director at t.docxedwardk6
 
Doppler Effect- True or False John is listening to a horn- He knows th.docx
Doppler Effect- True or False John is listening to a horn- He knows th.docxDoppler Effect- True or False John is listening to a horn- He knows th.docx
Doppler Effect- True or False John is listening to a horn- He knows th.docxedwardk6
 
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docx
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docxDQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docx
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docxedwardk6
 

Mais de edwardk6 (19)

Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docx
Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docxIdentify which of the following is NOT a TCP-IP Attack- Question 5 opt.docx
Identify which of the following is NOT a TCP-IP Attack- Question 5 opt.docx
 
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docx
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docxIdentifying Matter- Physical Properties (Section 1-4 15- The elements.docx
Identifying Matter- Physical Properties (Section 1-4 15- The elements.docx
 
Identifying aclds and bases by their reaction with water Kri Some chem.docx
Identifying aclds and bases by their reaction with water Kri Some chem.docxIdentifying aclds and bases by their reaction with water Kri Some chem.docx
Identifying aclds and bases by their reaction with water Kri Some chem.docx
 
Identify the two primary sources of stockholders equity- and which sou.docx
Identify the two primary sources of stockholders equity- and which sou.docxIdentify the two primary sources of stockholders equity- and which sou.docx
Identify the two primary sources of stockholders equity- and which sou.docx
 
If you had a system- that had large amounts of daily data inflows- tha.docx
If you had a system- that had large amounts of daily data inflows- tha.docxIf you had a system- that had large amounts of daily data inflows- tha.docx
If you had a system- that had large amounts of daily data inflows- tha.docx
 
If two points are in a common reference frame- then a They are not in.docx
If two points are in a common reference frame- then a They are not in.docxIf two points are in a common reference frame- then a They are not in.docx
If two points are in a common reference frame- then a They are not in.docx
 
Identify at least two types of system architectures that work well in.docx
Identify at least two types of system architectures that work well in.docxIdentify at least two types of system architectures that work well in.docx
Identify at least two types of system architectures that work well in.docx
 
Identify and prioritize information assets- Identify and prioritize th.docx
Identify and prioritize information assets- Identify and prioritize th.docxIdentify and prioritize information assets- Identify and prioritize th.docx
Identify and prioritize information assets- Identify and prioritize th.docx
 
If the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docxIf the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docx
 
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docx
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docxE13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docx
E13-7 On January 1- 2010- the stockholders-' equity section of Nunez C.docx
 
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docx
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docxE 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docx
E 4- Elijah Samuels and Tony Winslow agreed to form a partnership- Sam.docx
 
During October- Wichita Light Company experiences the following transa.docx
During October- Wichita Light Company experiences the following transa.docxDuring October- Wichita Light Company experiences the following transa.docx
During October- Wichita Light Company experiences the following transa.docx
 
During a total lunar eclipse- in which the moon passes entirely into t.docx
During a total lunar eclipse- in which the moon passes entirely into t.docxDuring a total lunar eclipse- in which the moon passes entirely into t.docx
During a total lunar eclipse- in which the moon passes entirely into t.docx
 
During 2011- Arthur Corportation reported a net income of $3-059-000-.docx
During 2011- Arthur Corportation reported a net income of $3-059-000-.docxDuring 2011- Arthur Corportation reported a net income of $3-059-000-.docx
During 2011- Arthur Corportation reported a net income of $3-059-000-.docx
 
Driving School has 4 learning centres- The network of each learning ce.docx
Driving School has 4 learning centres- The network of each learning ce.docxDriving School has 4 learning centres- The network of each learning ce.docx
Driving School has 4 learning centres- The network of each learning ce.docx
 
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docx
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docxDonnie Hilfiger has two classes of stock authorized- S1 par preferred.docx
Donnie Hilfiger has two classes of stock authorized- S1 par preferred.docx
 
Doris Washington recently assumed her new position as HR Director at t.docx
Doris Washington recently assumed her new position as HR Director at t.docxDoris Washington recently assumed her new position as HR Director at t.docx
Doris Washington recently assumed her new position as HR Director at t.docx
 
Doppler Effect- True or False John is listening to a horn- He knows th.docx
Doppler Effect- True or False John is listening to a horn- He knows th.docxDoppler Effect- True or False John is listening to a horn- He knows th.docx
Doppler Effect- True or False John is listening to a horn- He knows th.docx
 
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docx
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docxDQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docx
DQ #4 Explain the US Government Thrift Savings Plans-SolutionThe US Go.docx
 

Último

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Último (20)

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

if i want to remove all the files in my current working directory usin.docx

  • 1. if i want to remove all the files in my current working directory using UNIX , i have a script and one of thie lines of this script is rm -rf /*Â Â would this work ? please explain why or why not ?? this is in C what is the type of the parameter argv to the main funtion in a C proggram ? Solution UNIX rm command rm-remove directory that removes files and directories. The parameters of rm command is as follows rm -rf where r refers to remove files and directories recursively if contains nested directories. f refers to forcibly delete the directories and file if not exists without prompt user to choose the decision about the file or directory. argv is a parameter name of the character string that takes an array of string arguments from main method of c program. --------------------------------------------------------------------------------------------------------------------- --- //Sample program that demonstrates the use of argv vector array //test.c #include<stdio.h> #include<conio.h> //main function int main(int argc, char * argv) { //Assign the argc to count int count=argc; int index; //argv[0] represents the name of the program, test.c //prints the strings in argv
  • 2. for(index=1;index<count;index++) printf("%s ",argv[index]); //pause program output on console. system("pause"); return 0; } Sample output: C:test.c hello c world output: hello c world